July 20, 2013 at 5:53 pm #26509
By default, when the page sidebar submenu items are displayed, they are ordered alphabetically.
As an example, if I have a main menu in the header with an About Us page with hovered submenus, such as:
and then if I view the About Us page, the submenu in the page sidebar menu gets re-ordered alphabetically to:
This causes disorientation (especially in very long submenus) since the main menu hovered submenus have a very specific order of priority.
Can anyone supply a code modification to render the sidebar submenus in the same order as they appear within the main menu submenus?
Thanks for any help you can provide me.
DarrylJuly 22, 2013 at 5:20 am #130669
1) Try to replace following line in functions-enfold.php
$args = array('title_li'=>'', 'child_of'=>$parent, 'echo'=>0, 'sort_column'=>'menu_order, post_title');
$args = array('title_li'=>'', 'child_of'=>$parent, 'echo'=>0, 'sort_column'=>'menu_order');
2) If this doesn’t help make sure you set a valid menu order value for all pages (“Pages Attributes” field on the page editor page). You can also try http://wordpress.org/plugins/post-types-order/July 22, 2013 at 9:08 am #130670
Thanks for your help with this Devin. Your solution works almost entirely, but one set of pages is resorting to alphabetic. I have a screencast here showing this, could you please watch (90 secs) and see if it highlights anything to you: http://screencast.com/t/ZcLHMjkg
I really appreciate your help with this.
DarrylJuly 24, 2013 at 2:46 am #130671
What would happen if you changed the order of the menu items in Appearance Menu for the one that isn’t showing it correctly. Does it make any difference? What about if you switch the Restaurants (the first one that becomes last in sidebar) and move it to a different sub menu? And last what If you made just a new page calling it anything else and placing it in place of Restaurant or as the Parent? I assume you have all the pages in the sub menu as child pages of the main parent, correct? Because in that bit of code you showed at the end I saw something about order same as menu, but left of it something about child/parent. Please check that it really is the case.
NickAugust 1, 2013 at 1:06 am #130672
Thanks for your support with this Nick.
Re your first idea, when I reordered via Appearances > Menu it changes the order in the main menu hovered submenu, but not in the sidebar.
Re your second idea, moving the submenu to a different sub menu did change the position in the main menu and hovers, but it did not move it in the sidebar, it stayed in the original place, still in the original wrong.
Immediately therafter, I moved the submenu back to the previous menu location and then the website displayed everything as intended. Do you have any idea why it would correct from something like that?
Thanks Nick, I hope it stays put now ;) as it doesn’t make any sense to me why it would behave like that.August 1, 2013 at 4:56 am #130673
Hmmm, having said that, the sub-sub-menus are having the same issue, and that prior little fix doesn’t seem to fix them.August 1, 2013 at 4:58 am #130674
Reordering the sub-sub menu siblings after doing the above step has worked…I hope this doesn’t happen again, doesn’t seem a very reliable menu system.August 1, 2013 at 4:59 am #130675
Thanks for your ideas Nick, got me off in the right direction, much appreciated.August 1, 2013 at 11:22 am #130676
There is often an inherent problem with WordPress core that I noticed where sometimes thing need to be moved around a bit before initially saving them. I like to almost shuffle my menus a few times,,, sort of to warm it up. Same goes for the widgets and sidebars, good idea to move them a bit around, somehow it works (or maybe I am just projecting lol).
Enjoy the theme!
The topic ‘How to ReOrder Page Sidebar Submenu Items’ is closed to new replies.