Forums

comments select statement (5 posts)

  1. iperez_genius
    Member
    Posted 2 years ago #

    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?

  2. James
    Happiness Engineer
    Posted 2 years ago #

    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

    If you're after something more complicated, would you please describe what you're trying to do?

  3. iperez_genius
    Member
    Posted 2 years ago #

    i have installed this plugin in.

    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

  4. James
    Happiness Engineer
    Posted 2 years ago #

    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.

  5. Darrell Schauss
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags