WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How do I get pages to not sort by ID in wp_list_pages

[Resolved] How do I get pages to not sort by ID in wp_list_pages

  • I have an order set in include= but it is not following that order but the ID instead.
    Here’s how I have it:
    <?php wp_list_pages('sort_column=menu_order&title_li=&include=131,16,29,75,21&exclude=2,50,71,90,98,105,108,131,154');?>

    How do I get it to display as I want it?

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • newsdevice
    Member

    @newsdevice

    I’m pretty sure you don’t need both include & exclude, one or the other.

    <?php wp_list_pages('sort_column=menu_order&title_li=&include=131,16,29,75,21');?
    >

    You were correct about not having both but it is still showing by ID…

    On each page there’s a sort field. Align the sort of the pages with that box.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] How do I get pages to not sort by ID in wp_list_pages’ is closed to new replies.