veronica 2 Report post Posted August 26, 2010 Hello, How do you put the sub navigation in a particular order? I do not like the default ordering and would like it to be ordered very particularly. Share this post Link to post Share on other sites
bryan-hadaway 3 Report post Posted August 27, 2010 In: Appearance > Menus You drag and drop any order you wish, adding sub tabs under top level ones like so: - Top Level Tab - Sub Tab - Sub Tab Thanks, Bryan Share this post Link to post Share on other sites
veronica 2 Report post Posted August 27, 2010 Thank you. I've done this but the menu did not change and is appearing the same way. Here is the php code for sub_menu, in case this helps (although I have not modified it from the original template): <div id="subnav" class="fix"> <?php if($post->post_parent || wp_list_pages("title_li=&child_of=".$post->ID."&echo=0")):?> <span class="subnav_first"> </span> <?php if(count($post->ancestors)>=2){ $reverse_ancestors = array_reverse($post->ancestors); $children = wp_list_pages("title_li=&depth=1&child_of=".$reverse_ancestors[0]."&echo=0&sort_column=menu_order"); }elseif($post->post_parent){ $children = wp_list_pages("title_li=&depth=1&child_of=".$post->post_parent."&echo=0&sort_column=menu_order"); }else{ $children = wp_list_pages("title_li=&depth=1&child_of=".$post->ID."&echo=0&sort_column=menu_order");} if ($children) { echo $children;} ?> <span class="subnav_last"> </span> <?php endif;?> </div><!-- /sub nav -->[/code] Share this post Link to post Share on other sites
cmunns 16 Report post Posted August 27, 2010 There are a number of ways to sort the sub menu by modifying a parameter in the function. For example here are some options sort_column (string) Sorts the list of Pages in a number of different ways. The default setting is sort alphabetically by Page title. * 'post_title' - Sort Pages alphabetically (by title) - default * 'menu_order' - Sort Pages by Page Order. N.B. 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 Write>Pages administrative panel. See the example below. * 'post_date' - Sort by creation time. * 'post_modified' - Sort by time last modified. * 'ID' - Sort by numeric Page ID. * 'post_author' - Sort by the Page author's numeric ID. * 'post_name' - Sort alphabetically by Post slug. Share this post Link to post Share on other sites
veronica 2 Report post Posted August 28, 2010 I don't understand what you mean by Write>Pages administrative panel. Also, why doesn't dragging the sub tabs work the way it's supposed to, instead of me having to edit the PHP myself? You mention that the default setting is to sort alphabetically by Page title. It is not doing this on the sub navigation, although it is doing this on the sidebar which currently displays all pages on my site. Share this post Link to post Share on other sites
cmunns 16 Report post Posted August 30, 2010 We actually were just looking into having the subnav work with WP3.0 menus in this way so it could be used for more than just the drop down. Unfortunately, the menu system in WP is not very robust yet and they didn't take this into consideration. This is why it is handled separately, out of necessity.( I think Bryan was confused or mistakent ) if you let me know what order you want I can help you get it in that order at least close based the parameters I listed before. Share this post Link to post Share on other sites
veronica 2 Report post Posted August 30, 2010 Thank you cmunns - is there an e-mail address which you supply me with so that I can contact you directly with the url of the site in question? I do not wish it to be made public. Share this post Link to post Share on other sites
bryan-hadaway 3 Report post Posted August 31, 2010 Considering you have the latest theme version, WordPress version, that you set your page order and parents when editing pages and that you create your custom menu correctly, you should never have to manually edit the code. Some find this tiresome if they didn't do this from the beginning and now have many pages, so custom coding may be more ideal. Thanks, Bryan Share this post Link to post Share on other sites