I need to calculate the average rating of the comment and place that value as a rating star at other page. For example. If the average rating value is “3 star”. I want to print that value as “3 star image” and place that image at the another page. I asked this question in many site but not getting any answer. Please help me somebody

$plugin_url_path = WP_PLUGIN_URL;
if( $commenttitle = get_comment_meta( get_comment_ID(), 'title', true ) ) {
    $commenttitle = '<strong>' . esc_attr( $commenttitle ) . '</strong><br/>';
    $text = $commenttitle . $text;
if( $commentrating = get_comment_meta( get_comment_ID(), 'rating', true ) ) {
    $commentrating = '<p class="comment-rating">    <img src="'. $plugin_url_path .
    '/ExtendComment/images/'. $commentrating . 'star.gif"/><br/>Rating: <strong>'. $commentrating .' / 5</strong></p>';
    $text = $text . $commentrating;
    return $text;       
} else {
    return $text;       


Read more here: How to calculate the average Rating from the Extended Comment WordPress Plugin?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , ,

Wordpress related questions and answers: