PHP and wordpress: Sorting Menu items
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&am开发者_运维技巧p;')?>
</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.
Try this:
wp_list_pages('sort_column=ID&sort_order=desc&title_li=&depth=1&');
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.
精彩评论