WordPress.org

Support

Support » How-To and Troubleshooting » Sort Order for Pages not working

Sort Order for Pages not working

  • I am trying to use the menu order from the Manage Pages section in admin to sort my Pages links in the sidebar menu. They are displaying in alphabetical order, even though I think I have the right code to sort them by menu_order. Here is the code…

    <?php wp_list_pages('exclude=2, sort_column=menu_order&title_li=<h4>' . __('Main Menu') . '</h4>' ); ?>

    Any ideas? Thanks 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think you probably need it to say exclude=2& instead of a comma.

    Yes, that was it! Thank you very much 🙂

    I also have a plugin I’m working on that has a bunch of helper functions for working with pages. Including a get_pages function that defaults to ordering BY ORDER — I mean, that’s what the field is for! Also a function to just get the ordered array, and let you process through it custom.

    Having seen this question, I’ll definitely start poking around the ‘extra’ params to the pages function, like excluding a given page. Though if you iterate yourself, you can obviously drop any page you don’t want. 😉 😉

    -d

    @davidchait:
    i was browsing your site but could not find anywhere a plugin with the description you said…as i am already looking for this for ages,maybe you can point me where to find your plugin ?
    thanks in advance 😉

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sort Order for Pages not working’ is closed to new replies.
Skip to toolbar