Title: Sort Replies Without Custom Query
Last modified: August 31, 2016

---

# Sort Replies Without Custom Query

 *  [Andrew Tibbetts](https://wordpress.org/support/users/andrewgtibbetts/)
 * (@andrewgtibbetts)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/sort-replies-without-custom-query/)
 * Making a custom query do all the stuff that `if ( bbp_has_replies() ): while (
   bbp_replies() ): bbp_the_reply(); endwhile; endif;` is not feasible.
    I tried
   modifying the query via `pre_get_posts` but adding the `vote_sort` – `score_desc`
   doesn’t seem to have any effect. code:
 *     ```
       add_action( 'pre_get_posts', 'custom_pre_get_posts' );
       function custom_pre_get_posts( $query ) {
   
       	if ( bbp_is_single_topic() && ! $query->is_main_query() && ! is_admin() && $query->query_vars['post_type'] == 'reply' && $query->query_vars['post_parent'] ) {
   
       		$query->query['vote_sort'] = 'score_desc';
       		$query->set( 'vote_sort', 'score_desc' );
       	}
       }
       ```
   
 * WP: 4.4.2
    BP: 2.4.3 BBP: 2.5.8
 * [https://wordpress.org/plugins/bbpress-votes/](https://wordpress.org/plugins/bbpress-votes/)

The topic ‘Sort Replies Without Custom Query’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bbpress-votes.svg)
 * [bbPress Votes](https://wordpress.org/plugins/bbpress-votes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bbpress-votes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bbpress-votes/)
 * [Active Topics](https://wordpress.org/support/plugin/bbpress-votes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bbpress-votes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bbpress-votes/reviews/)

## Tags

 * [order](https://wordpress.org/support/topic-tag/order/)
 * [orderby](https://wordpress.org/support/topic-tag/orderby/)
 * [sort](https://wordpress.org/support/topic-tag/sort/)

 * 0 replies
 * 1 participant
 * Last reply from: [Andrew Tibbetts](https://wordpress.org/support/users/andrewgtibbetts/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/sort-replies-without-custom-query/)
 * Status: not resolved