Integrate GD Star Rating into comments form

  • KevinN


    I’m trying to integrate a rating option into my comments form. I have GD Star Rating added as a working plugin, but I want users/visitors to be able to enter their own review to the post via the comments field.

    To do this I need to add the following code to the comments form…

    <?php if (defined("STARRATING_INSTALLED")) : ?>
    <p><?php wp_gdsr_comment_integrate_standard_rating(); ?>
    <label for="url"><small>Rating</small></label>
    </p><?php endif; ?>

    which i got from this post:

    But i’m not finding where to put this code. I’ve looked at the using a chile and the functions.php but it is not clear where I would put this. It would be great to have this display just above or below the text field in the form.


    Kenneth John Odle


    Okay, this looks cool if you can get it to work.

    I would use a Graphene action hook widget area. To learn how to do this, start with this tutorial:

    I would suggest using the “graphene_before_commentform” widget area in comments.php.

    Because you are trying to insert php code, you will also need to install the PHP widget; instructions are in the tutorial.

    Give it a shot and let us know if you run into problems or if you get it working.


    (Code between backticks, please. I’ve fixed this for you.)



    Thanks so much for the quick response and excellent advice. worked as advertised!

    I really do appreciate it.



    Kenneth John Odle


    I’m glad it worked. Post a link sometime. I’d love to see this in action.



    The review block is rendered and works as I had hoped, but the display isn’t ideal. I would love it if i could get it to display after the ‘leave a reply’ text. You can see an example on my site here…

    My next hurdle is to tackle getting the ratings to display in each comment. There is another post about this

    but it does not offer much information and I’m stumped…

Viewing 5 posts - 1 through 5 (of 5 total)

  • You must be logged in to reply to this topic.
Graphene Themes Forum