September 23, 2013 at 8:35 pm #165280
In a previous post I raised an issue of the page sidebar menu order being out of synch with the main menu flyout order: http://www.kriesi.at/support/topic/how-to-reorder-page-sidebar-submenu-items/
These sidebar menus weren’t accurately reflecting the order set in Appearance > Menus but were instead ordering alphabetically. Rearranging the appearances > menu order didn’t rearrange the sidebar order.
Dude and Nick supplied some help but it didn’t resolve predictably before the topic was closed.
I have modified the sidebar menu order to remove post title, as Dude advised:
$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');
This did remove the alphabetising, but still didn’t reflect the order set in Appearances > Menu
Another idea was offered to force the menu order by numbering the sort order explicitly, but this seems a short-term solution which becomes confusing and error-prone with an often changing architecture, particularly with deep menu lists.
An automated method would be so much better.
Is there a way in php to completely nullify any other sort method being applied, and then apply menu_order?
An example of the issue can be seen here: http://itchybrain.com.au/mfs/projects/ where the hover/flyout menu is accurately showing what is set in Appearances > Menu but the sidebar does not change to be the same.
p.s. moving the submenus to other parents, saving, then moving back, resaving, didn’t help.
Thanks for any attention you can give this.
DarrylSeptember 26, 2013 at 8:08 am #166478
You may want to take a look at this plugin, it allows you to alter the default order of pages, so you can mimic the already ordering from Appearances > Menu.
JosueSeptember 26, 2013 at 8:12 am #166480
Thanks for helping me with this. I actually use that plugin, although only for convenience of editing pages. What do you foresee I could do with that plugin to overcome the ordering?
DarrylSeptember 26, 2013 at 8:14 am #166481
Sorry, I use it’s sibling plugin Admin Tree Page view. This other one looks like drag and drop rearranging, I’ll see if it takes precedent in both areas.September 26, 2013 at 8:20 am #166484
Awesome, it worked. So Josue, what could that plugin be doing that helps this reorder take place? The functionality it offers overcomes something that I think should be working properly in Enfold. Or is it perhaps a WordPress issue?September 26, 2013 at 4:32 pm #166689
Glad it’s working for you, the plugin alters the ‘menu_order’ of pages, which have nothing to do with any Menu (Appearance) order.
For further information: http://codex.wordpress.org/Function_Reference/wp_list_pages
‘menu_order’ – Sort Pages by Page Order. Note the difference between Page Order and Page ID. The Page ID is a unique number assigned by WordPress to every post or page. The Page Order can be set by the user in the Pages→Edit panel. See the example below.
JosueSeptember 26, 2013 at 9:08 pm #166735
Thanks for explaining that Josue. The link to an example was missing.
So the logic in functions-enfold for the sidebar calls the menu_order, and of course will display whatever the order is set to…it just happens to differ from Appearances Menu ordering.
Prior to using a plugin such as the one that is helping me to reorder the items, do you know what mechanism is making the original order?
Ultimately I’d like to create a function that logically forces the menu_order to match the Appearance Order, and add it to my functions, rather than use a plugin. Any ideas about how to achieve that?
DarrylSeptember 26, 2013 at 9:12 pm #166737
Pls disregard the example, I see it was part of the Codex quote, and found that example in the codex.September 26, 2013 at 10:37 pm #166744
I don’t think there is a way to ‘link’ the Menu order with the wp_list_pages order, i see it easier invoking the menu listing as a Menu, rather than as the default page list widget.
JosueSeptember 27, 2013 at 10:51 am #167089
You can use this plugin: http://wordpress.org/plugins/post-types-order/ to change the order of your posts/pages, etc. with drag’n’drop. It won’t sync the Appearance > Menu order with the page order but it will help you to order your pages more efficiently.
What you try to do imo doesn’t make sense because the order of the pages in the menus is not necessarily unique. Eg you could add the same page to the same menu multiple times or you could add the same page to several menus and each menu uses a different order for the links. How would you determine the right page order for wp_list_pages if the same page (or even pages) have several occurrences?
The topic ‘How to make Page Sidebar Menus have the same order set in Appearances > Menu’ is closed to new replies.