Title: Sorting pages in header menu
Last modified: August 18, 2016

---

# Sorting pages in header menu

 *  [alda](https://wordpress.org/support/users/alda/)
 * (@alda)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/sorting-pages-in-header-menu/)
 * 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](http://www.testsite.aldasigmunds.com)

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/sorting-pages-in-header-menu/#post-514262)
 * You can control the sort order or [Pages](http://codex.wordpress.org/Pages) by
   using the ‘sort_column’ parameter in the [Template Tag](http://codex.wordpress.org/Template_Tags),
   [wp_list_pages](http://codex.wordpress.org/Template_Tags/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](https://wordpress.org/support/users/alda/)
 * (@alda)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/sorting-pages-in-header-menu/#post-514289)
 * 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???
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/sorting-pages-in-header-menu/#post-514301)
 * 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.

## Tags

 * [order](https://wordpress.org/support/topic-tag/order/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [19 years, 5 months ago](https://wordpress.org/support/topic/sorting-pages-in-header-menu/#post-514301)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
