Ready to get started?Download WordPress


Sort Order for Pages not working (5 posts)

  1. Lori
    Posted 9 years ago #

    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 :)

  2. oriecat
    Posted 9 years ago #

    I think you probably need it to say exclude=2& instead of a comma.

  3. Lori
    Posted 9 years ago #

    Yes, that was it! Thank you very much :)

  4. davidchait
    Posted 9 years ago #

    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. ;) ;)


  5. flashbrother
    Posted 9 years ago #

    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 ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic