Title: comments select statement
Last modified: August 19, 2016

---

# comments select statement

 *  [iperez_genius](https://wordpress.org/support/users/iperez_genius/)
 * (@iperez_genius)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/comments-select-statement/)
 * I am looking for the location in the wordpress system of the sql for selecting
   the comments for a specific post.
 * does anybody know where this is?

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

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/comments-select-statement/#post-1480618)
 * If you’re talking about simply displaying the comments in your theme, use the`
   wp_list_comments` tag:
 * [http://codex.wordpress.org/Template_Tags/wp_list_comments](http://codex.wordpress.org/Template_Tags/wp_list_comments)
 * If you’re after something more complicated, would you please describe what you’re
   trying to do?
 *  Thread Starter [iperez_genius](https://wordpress.org/support/users/iperez_genius/)
 * (@iperez_genius)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/comments-select-statement/#post-1480696)
 * i have installed this plugin in.
 * [http://wordpress.org/extend/plugins/comment-rating/](http://wordpress.org/extend/plugins/comment-rating/)
 * now based on the users rating of the comments i would like to re-order the comments
   from most liked to least liked…hence i am in search of the original sql so i 
   can re-write it to incorporate such a function.
 * is this the best way to do this?
 * Ilan
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/comments-select-statement/#post-1480705)
 * Well, I’m not an expert at messing with the core code, and I typically recommend
   against it as it could always break something else and will certainly make automatic
   updates useless.
 * If you can, I recommend dissecting how `wp_list_comments` actually lists comments,
   then write a plugin integrating that with the Comment Rating plugin.
 * I have never written a plugin before, so that’s just a general “you should be
   able to” suggestion. I’m sure someone around here may have some better ideas.
 *  [dralezero](https://wordpress.org/support/users/dralezero/)
 * (@dralezero)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/comments-select-statement/#post-1480710)
 * I would say “you should be able to” edit the comment rating plugin to sort them.
   But I looked at the code and don’t see where to even start, that might be some
   work. The sorting is available in the Pro version of the plugin though which 
   costs money.

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

The topic ‘comments select statement’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [dralezero](https://wordpress.org/support/users/dralezero/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/comments-select-statement/#post-1480710)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
