Title: Comment sorting not working
Last modified: August 30, 2016

---

# Comment sorting not working

 *  Resolved [Teunel](https://wordpress.org/support/users/teunel/)
 * (@teunel)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/comment-sorting-not-working/)
 * Hi,
 * I am using the theme “blackbird”, and I have the rating system set up for comments
   only.
 * I also have the setting “Order comments” turned on, however it does not work 
   for me.The order does not change, even when the second comment has more upvotes
   than the first one.
 * What could be causing this?
 * [https://wordpress.org/plugins/rating-system/](https://wordpress.org/plugins/rating-system/)

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

 *  Plugin Author [Alex Alexandru](https://wordpress.org/support/users/vortexthemes/)
 * (@vortexthemes)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/comment-sorting-not-working/#post-6642372)
 * I just downloaded the blackbird theme and is working for me…. strange.Try another
   theme and let me know if is working.Also support will be limited I’m in college
   and I don’t have internet acces.
 *  [Anda Pop](https://wordpress.org/support/users/andapop/)
 * (@andapop)
 * [10 years ago](https://wordpress.org/support/topic/comment-sorting-not-working/#post-6642525)
 * Hello,
    I see this is marked as resolved, but the sorting by likes/dislikes is
   not working for me. I tried it on a fresh WP 4.5.1 install, with twentysixteen
   as a theme, and no other active plugins.
 * I looked through the plugin’s code s bit and I couldn’t find where you set how
   the query var ‘orderby’ gets interpreted when it is equal to ‘likes’ or ‘dislikes’.
   
   Did I miss something in the code? Is this implemented in a different way?
 * I tried a fix, that seems to work (add the code to functions.php)
 *     ```
       function vortex_system_column_orderby( $vars ) {
       	if ( isset( $vars['orderby'] ) ) {
       		if( 'likes' == $vars['orderby'] ) {
       			$vars = array_merge( $vars, array(
       				'meta_key' => 'vortex_system_likes',
       				'orderby' => 'meta_value_num'
       			) );
       		} elseif ( 'dislikes' == $vars['orderby'] ) {
       			$vars = array_merge( $vars, array(
       				'meta_key' => 'vortex_system_dislikes',
       				'orderby' => 'meta_value_num'
       			) );
       		}
       	}
   
       	return $vars;
       }
       add_filter( 'request', 'vortex_system_column_orderby' );
       ```
   

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

The topic ‘Comment sorting not working’ is closed to new replies.

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

 * 2 replies
 * 3 participants
 * Last reply from: [Anda Pop](https://wordpress.org/support/users/andapop/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/comment-sorting-not-working/#post-6642525)
 * Status: resolved