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

I am working on a Mini Job Site.

i want to give rating to posts manually from admin / editor side

Best rated people will be on top. so visitor'll get better choice.

visitor are not allowed to rate posts

like this

please have a look

how to do this ?

{1} Meta-box uses {2} Custom Field

help me please

share|improve this question
do you use some kind of plugin, if so provide link. – amit Aug 3 '12 at 11:44
no Amit .. not using – Nisha_at_Behance Aug 3 '12 at 11:50
up vote 2 down vote accepted

Here's something I'd use if I want to do that without using plugins

Create a custom field as rating and provide the value while doing post. Suppose I gave a rating of 6, Now wordpress save it into the database as.

  • meta_key => rating
  • meta_value => 6

Now to show the rating on post I'll use this code into single.php or index.php but make sure to put it within Wordpress loop -

    //grab the rating value
    $rating = get_post_meta($post->ID, 'rating', true);

    //prints star image
    for ($i=1; $i<=$rating; $i++){
        echo '<img src="LINK-TO-STAR-ICON"/>';

    //prints unstar image
    for ($i=$rating; $i<10; $i++){
        echo '<img src="LINK-TO-UNSTAR-ICON"/>';

The above code will result like this - enter image description here

share|improve this answer
If that helped, consider up voting it. – amit Aug 3 '12 at 13:07
Amit, Custom field not working if you can help me i m not very smart in php. $rating = get_post_custom_keys(); foreach ( $rating as $key => $value ) { echo $key . " => " . $value . "i+"; } – Nisha_at_Behance Aug 3 '12 at 13:47
what exactly not working. ? – amit Aug 3 '12 at 13:49
custom field not showing in post section – Nisha_at_Behance Aug 3 '12 at 13:54
My code works great on my site, Why you 're using that other code ? – amit Aug 3 '12 at 13:59

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.