• Hi

    I’ve been fiddling around with my sidebar code to get the pages to sort according to the page order set in the admin panel. That worked, but they are still in the previous order in the menu that is above the header. How do I get them to display in the same order as the pages on the sidebar? Anyone?

    Thanks in advance for your help.

    http://www.testsite.aldasigmunds.com

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can control the sort order or Pages by using the ‘sort_column’ parameter in the Template Tag, wp_list_pages.

    You might want to check your header.php and sidebar.php files to make sure they use the same syntax/code for displaying those pages.

    Thread Starter alda

    (@alda)

    Thanks for the reply. I’ve scanned through the header.php file and can’t find anything exactly like the code in the sidebar file. I found this:

    <?php wp_list_pages(‘title_li=&depth=1&’.$page_sort.’&’.$pages_to_exclude)?>

    … and replaced it with the sidebar code (

      <?php wp_list_pages(‘title_li=’); ?>

    ), however it puts one word with a slash through it at the top of the page, and doesn’t sort the pages like in the sidebar.

    The only other code I can see that mentions pages is this:

    <?php
    global $page_sort;
    if(get_settings(‘justsimple_sortpages’)!=”)
    {
    $page_sort = ‘sort_column=’. get_settings(‘justsimple_sortpages’);
    }
    global $pages_to_exclude;

    if(get_settings(‘justsimple_excludepages’)!=”)
    {
    $pages_to_exclude = ‘exclude=’. get_settings(‘justsimple_excludepages’);
    }
    ?>

    … But it doesn’t look remotely like the other, sidebar, code.

    Help???

    Actually, that looks like your Theme may give you some admin panel options that control the order of the Pages as well as what Pages would get excluded. Might want to set it back to the original code and look at your admin panel.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Sorting pages in header menu’ is closed to new replies.