WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using WP-Postratings to show thumbs up or down for posts and I want to show on the homepage in post excerpts whether a post in in the plus or minus. If it's in the plus I want to show a custom image but if the negative I want to show a different image. Any ideas on how to do that?

share|improve this question
up vote 0 down vote accepted

Ok I figured this out. The ratings score is stored as a custom field so I created and if statements to check whether the score was less, equal, or greater than 0 and then I can show something accordingly. Here's how I set it up.

  $ratings_score = get_post_meta($post->ID,'ratings_score',true); 
  if ($ratings_score < 0 ) {
      echo '<span>Plus</span>'; 
      } elseif ($ratings_score > 0 ) {
      echo '<span>Minus</span>';
      } else {
      echo '<span>Even</span>';
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.