Support » Fixing WordPress » WP LIST in reverse order

  • lowercase

    (@lowercase)


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • vkaryl

    (@vkaryl)

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

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

    lowercase

    (@lowercase)

    Nice one.

    That worked perfectly!

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

    vkaryl

    (@vkaryl)

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP LIST in reverse order’ is closed to new replies.