views:

31

answers:

3

I'm working on a wordpress site, customizing the menu. I'm no php whiz, and I want the menu to sort according to the numerical order, not desc alphabetically.

<div id="navigation">
  <ul> 
  <?php wp_list_pages('sort_column=post_title&sort_order=desc&title_li=&depth=1&')?>
  </ul> 
</div><!-- end id:navigation -->

Any ideas how I do this? I've tried editing the above code, but I just lose the menu altogether.

A: 

Try this:

wp_list_pages('sort_column=ID&sort_order=desc&title_li=&depth=1&');
Stephen
@Stephen thanks, this was what I needed.
blackessej
You're Welcome.
Stephen
A: 

The docs for the function show how to get different sort orders: Function Reference/wp list pages « WordPress Codex. And you can select your own sort order for pages in the Page Editor itself, in the attributes panel.

songdogtech
@songdogtech I had looked into that previously. For some reason changing the page order in the Page Editor didn't do anything. Then it dawned on me: simply remove the `sort_order` in the `header.php` and it defaults to the order I defined in the editor. Thanks for the prompt response...nice to deal with someone in town, too ;)
blackessej
+1  A: 

Also consider using WordPress 3.0 new Menu feature ... this would allow the admin to create a custom menu, sort it via drag and drop and in your theme/page you can call a wp_nav_menu function to display the menu.

farinspace