Title: wp_list_page sorting
Last modified: September 7, 2020

---

# wp_list_page sorting

 *  [julesmeredith](https://wordpress.org/support/users/julesmeredith/)
 * (@julesmeredith)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/wp_list_page-sorting/)
 * I want to create a sitemap that lists pages alphabetically in ascending order
   and numerically descending eg:-
 * abc
    bcd cde 2020 cde 2019 cde 2018 def (etc….)
 * Using the sort_order argument I can create a list that is either “ASC” or “DESC”
   but this doe not give me the required result.
 * Is there any way to mix the sort method to combine ascending and descending criteria?
 * Any help gratefully received.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwp_list_page-sorting%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/wp_list_page-sorting/#post-13373796)
 * I was going to say to use multiple sort_order values, but the code won’t let 
   you. SQL would handle it, but the `get_pages` function has this code:
 *     ```
       if ( '' !== $sort_order && ! in_array( $sort_order, array( 'ASC', 'DESC' ), true ) ) {
         $sort_order = 'ASC';
       }
       ```
   
 * I suppose you could do your own SQL instead.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 7 months ago](https://wordpress.org/support/topic/wp_list_page-sorting/#post-13373841)
 * Or fetch them into an array and use one of the many PHP sort-related functions.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp_list_page sorting’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 2 replies
 * 3 participants
 * Last reply from: [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/wp_list_page-sorting/#post-13373841)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
