Support » Plugin: WP-PostRatings » Hide rating score if no ratings, for guest users only

Viewing 1 replies (of 1 total)
  • Roni Marinkovic

    (@ronimarinkovic)

    Finally… here it is if someone else needs it…
    This will show ratings for guest users only if there is a rating for that post. Use in single.php or your custom single template.

    $postid = get_the_ID();
    $rating = get_post_meta($postid, 'ratings_score', 'true');
    if ( !is_user_logged_in() && empty($rating)) {
    	echo '';
    } else {
    	echo '<div id="rating">'.the_ratings().'</div>';
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Hide rating score if no ratings, for guest users only’ is closed to new replies.