WordPress.org

Ready to get started?Download WordPress

Forums

WP LIST in reverse order (4 posts)

  1. lowercase
    Member
    Posted 7 years ago #

    I currently use the below code to generate my pages menu list...

    <?php wp_list_pages('sort_column=menu_order&title_li=<h2>' . __(Pages') . '</h2>' ); ?>

    I want my page list to appear in reverse order - most recent at top and oldest at bottom.

    I have read the tag I need to use is 'sort_order' and the ASC or DESC is used in conjunction. After playing around I just can't seem to add it to the right place in my above code.

    Can someone please add the sort_order command to my code above please? My attempts are throwing up errors.

    thanks,

    brett.

  2. vkaryl
    Member
    Posted 7 years ago #

    <?php wp_list_pages('sort_order=ASC&title_li=<h2>' . __(Pages') . '</h2>' ); ?>

    I *think*.... try it and post back, 'kay?

  3. lowercase
    Member
    Posted 7 years ago #

    Nice one.

    That worked perfectly!

    Thanks for the quick replay (and the right one at that!) haha.

  4. vkaryl
    Member
    Posted 7 years ago #

    You're welcome! I don't get things right half as often as I wish I did!

Topic Closed

This topic has been closed to new replies.

About this Topic