Title: Sorting series
Last modified: September 26, 2021

---

# Sorting series

 *  Resolved [edwinkort](https://wordpress.org/support/users/edwinkort/)
 * (@edwinkort)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/)
 * Is it possible to sort the series on number? Now the last posted entry will be
   shown first on the page. I really would like to be based on the series number(
   and also for in between books (1.5, 2.5 and so).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsorting-series%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Kemory Grubb](https://wordpress.org/support/users/w33zy/)
 * (@w33zy)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14918502)
 * Hello [@edwinkort](https://wordpress.org/support/users/edwinkort/)
 * Sorry about the delayed response, it took me a while figure this one out. You
   can try the code below.
 *     ```
       function wzy_change_sort_order( $query ) {
       	if ( is_tax( 'rcno_series' ) ) {
       		// @see https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters
       		$query->set( 'order', 'DESC' );
       		$query->set( 'orderby', 'meta_value_num' );
       		$query->set( 'meta_key', 'rcno_book_series_number' );
       	}
       }
       add_action( 'pre_get_posts', 'wzy_change_sort_order' );
       ```
   
 * Also, I can make no guarantee on how it will work with decimals as that is a 
   function of how WordPress itself works.
 *  Thread Starter [edwinkort](https://wordpress.org/support/users/edwinkort/)
 * (@edwinkort)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14919117)
 * I believe this need to be placed somewhere in one of the themes php files?
 *  Plugin Author [Kemory Grubb](https://wordpress.org/support/users/w33zy/)
 * (@w33zy)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14922371)
 * You’d add it to your theme’s `functions.php` file.
 *  Thread Starter [edwinkort](https://wordpress.org/support/users/edwinkort/)
 * (@edwinkort)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14925595)
 * When I add this to functions.php it doesn’t work. Unfrotuantely
 *  Plugin Author [Kemory Grubb](https://wordpress.org/support/users/w33zy/)
 * (@w33zy)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14926378)
 * I am now confused as to what it is you’re asking.
 * I just checked your website and the series taxonomy archive page is being correctly
   sorted by series number in descending order.
 *  Thread Starter [edwinkort](https://wordpress.org/support/users/edwinkort/)
 * (@edwinkort)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14926417)
 * Strange. On my browser(s) it all looks as if nothing has changed.
 * Going to [https://edwinleest.ddns.net/wordpress/index.php/recensies/series/lux/](https://edwinleest.ddns.net/wordpress/index.php/recensies/series/lux/)
   the books are sorted in the order I’ve read them.
 * Maybe I should have the function set ASCending istead of DESCending?
 * Jsut to make it clear, I don’t mean this thab [https://edwinleest.ddns.net/wordpress/index.php/series/](https://edwinleest.ddns.net/wordpress/index.php/series/)
    -  This reply was modified 4 years, 8 months ago by [edwinkort](https://wordpress.org/support/users/edwinkort/).
 *  Plugin Author [Kemory Grubb](https://wordpress.org/support/users/w33zy/)
 * (@w33zy)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14930023)
 * Did you try changing the sort order?
 *  Thread Starter [edwinkort](https://wordpress.org/support/users/edwinkort/)
 * (@edwinkort)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14930615)
 * Yes, changed it from DESC to ASC. in function.php
 *  Plugin Author [Kemory Grubb](https://wordpress.org/support/users/w33zy/)
 * (@w33zy)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14931711)
 * Do that resolve this request?
 *  Thread Starter [edwinkort](https://wordpress.org/support/users/edwinkort/)
 * (@edwinkort)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14931734)
 * o.. Yes. Sorry, forgot to mention this. Was too busy earlier.

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

The topic ‘Sorting series’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/recencio-book-reviews_486474.svg)
 * [Recencio Book Reviews](https://wordpress.org/plugins/recencio-book-reviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/recencio-book-reviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/recencio-book-reviews/)
 * [Active Topics](https://wordpress.org/support/plugin/recencio-book-reviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/recencio-book-reviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/recencio-book-reviews/reviews/)

## Tags

 * [sorting](https://wordpress.org/support/topic-tag/sorting/)

 * 10 replies
 * 2 participants
 * Last reply from: [edwinkort](https://wordpress.org/support/users/edwinkort/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/sorting-series/#post-14931734)
 * Status: resolved