DS-Rating for Wordpress

Please note: this is an archived page. The downloads are still available here, however I have stopped further development of this plugin. If you are a plugin developer, or just handy with PHP and Wordpress, then feel free to take the code and continue work on it. The code is released under the Creative Commons attribution non-commercial share alike license.

DS-Rating is a plugin for Wordpress that gives you the ability to add a rating to posts, anywhere from 0 to 5 (including half steps). Note that this plugin does not allow users to rate posts when browsing a site – It is only set up to allow publishers or administrators to add ratings when creating or editing a post.

Installing the plugin

To install the plugin, simply download the latest version (see top of page), unzip the contents and place them all in your /wp-contents/plugins folder, then activate the plugin from the Plugins section of your Wordpress administration site. Once activated the plugin will add a rating interface to the Write page of your administration site and also a page in the Options area, where you can set a number of options concerning the display of the ratings.

Note: This plugin has been tested on Wordpress 2 through to Wordpress 2.5. The original version of this plugin did work on 1.5, however I had to update a bunch of the code so that it was v2 compatible and I fear this will have rendered it useless in earlier versions. So install on them at your own risk!

Assigning a rating

The plugin adds a simple radio-button interface to the Write page in your Wordpress admin area. When you write a post, simply select the relevant radio button for the rating value you wish to assign to that post. By default, no rating will be assigned unless selected.

When you save/publish the post, this rating value is stored in the post metadata table of your database, ready to be referenced later on if desired. If you decide later on that you no longer want a rating assigned to a particular post, you can select the ‘No rating’ radio button from the Edit screen and re-save the post.

Displaying the rating

To output the rating on your website, you need to insert the following code into your templates, somewhere within the loop:

<?php if (function_exists('has_rating')){ if(has_rating()){ get_rating(); } } ?>

This code first of all checks that the correct function is available (ie. that the plugin is installed), then checks if a rating has been assigned to the current post. If both of these conditions are met, then the rating will be shown on the page. The reason I’ve included the checks here is so that if you decide to turn off the plugin at any point then it won’t break your site.

Note that you can also pass in an article ID if there is a specific post you would like to grab the rating for. In this case the code would be this:

<?php if (function_exists('has_rating')){ if(has_rating()){ get_rating('XX'); } } ?>

(You would need to replace ‘XX’ in the above with the ID of the post)

The standard output options will create a rating similar to the image below:

Rating options

The options page gives you control over certain aspects of the rating presentation. There are default values assigned to each of the options when the plugin is first activated.

Display options

There are two display options given for showing the rating on a post; using CSS, or using static images. The plugin defaults to using CSS for the display of ratings. This will output the following code:

<div class="rating-container"><div class="rating four">Rating: 4</div></div>

The advantage of this method is that the rating information will be picked up by text readers and search engines, and it only requires two images to be created (as opposed to having to create one image for each rating value). Plus, if you so desire, you could do away with all the CSS and the rating would still display as text on your page.

In the options page you can edit the CSS used for the display of the ratings — these styles are automatically added into the top of your pages — or if you prefer to keep all styles in an external stylesheet then you can define them externally and delete the CSS in the options page.

If selecting to use the Images option, then the output code will be:

<img src="..[url of image directory].../3.gif" alt="This entry has a rating of 3" class="rating-image" />

Each rating value will have it’s own image, and from the options page you can also specify the folder path to where your images are stored, and the image type (.jpg or .gif)

CSS for the rating display

The default CSS for the rating display uses a ‘layered’ approach. There are two DIVs used; the outer DIV has the ‘off’ rating image assigned as a background, and the inner DIV uses the ‘on’ rating image as a background. A separate CSS class is set up for each rating value, and these specify the width of the inner DIV. This width sets how much of the inner DIV will ’show’ over the top of the outer one. For a graphical representation of this, check out the image below:

List of rated posts

New in v1.1 – A new function (list_rated_posts) is now available so that you can display a list of posts that have ratings assigned to them (e.g. top 5 highest rated posts, or 10 most recent posts that have ratings). The format for using this function is as follows:

<?php list_rated_posts($prefix, $suffix, $limit, $orderby, $summary); ?>

The list function has a number of options you can set, which affect the display of this list:

All of the parameters in the function are optional, so in the most basic form you can just add the function into your Wordpress template like this:

<ol><?php list_rated_posts(); ?></ol>

This would output an ordered list of posts that have ratings, using the default settings (displaying the most recent 5 entries that have been rated).

When using the optional parameters you must specify each value within quotes, separated by a comma. The only exception to this is the $summary value, which should be set as TRUE or FALSE and not surrounded by quotes. You can read more about setting function parameters here in the WP codex.

An example of using this function to display the 10 highest rated posts, without showing post excerpts, would look like this:

<ol><?php list_rated_posts('', '', '10', 'rated_high', FALSE); ?></ol>

Note the empty quotes – if values are left empty the defaults will be used.

Plugin support

This plugin is supplied as-is, with no warranty or guarantee whatsoever. If you post a comment on this page, or get in touch via the contact area of this site, then I will endeavour to reply and help in any way I can, but I make no promises on that one as unfortunately I may not always have the time to do so.



Comments are no longer active, but I have left a copy of them here in case they prove useful to you.

  1. m-alo said: (on April 9th 2006, at 9:21 pm)

    This plugin is great!
    I used to have another plugin installed for showing ratings in my posts, but your plugin is much easier to use (and to modify too). I normally use a scale of six stars, including half-stars to rate the concerts I’ve seen (I’m from Denmark, and all the reviewers in the local newspapers use a scale of six stars!)
    I added a couple of lines in the code and changed a couple of images (only four images to change (two for each color) as I’m using the CSS option!) to show the six stars instead of the five…
    …and it works like a charm!
    Would be nice to have the ability to choose how many stars should be in the rating scale directly from the options page though, but not a must, as the plugin is so easy to modify.
    Thank You!

  2. Mike said: (on April 9th 2006, at 11:19 pm)

    Hey m-alo, thanks for the feedback! I’m glad you found it easy to modify for your needs. It’s a good idea to have the ability to edit the number of stars (or rather the highest rating value) from the options page — maybe I can add it for a future version :)

  3. cbvivi said: (on April 12th 2006, at 9:58 am)

    oh i thought it’s something let the readers rate my posts:)
    thanks any more

  4. m-alo said: (on April 13th 2006, at 2:00 pm)

    Small problem: when I use a rating of 0 (zero) stars, it shows up as if i used 6 stars (all stars filled when they should be empty!), I can’t figure out what’s wrong?

  5. m-alo said: (on April 13th 2006, at 2:07 pm)

    Sorry… My mistake! Stupid me! I was missing a line in the css-code!

  6. Mike said: (on April 14th 2006, at 2:39 pm)

    cbvivi: Yes, this one is only for people who want to put a rating on the posts they write. But there are quite a few other plugins that do allow others to rate a post when reading it. Hope you find what you are looking for :)

    m-alo: I presume it was just a missing width attribute in the CSS? For any rating values that don’t have CSS widths defined they will default to being full-width (ie full stars). Glad you got it sorted OK :)

  7. pepemazas said: (on April 18th 2006, at 11:04 am)

    Great plugin!

    One question: How can i do to show a text only if the post was scored?

    If i insert the code:

    the wordpress return me a beautiful error message. Thanks.

  8. pepemazas said: (on April 18th 2006, at 11:14 am)

    I want to insert a text before “get rating”.

  9. Mike said: (on April 18th 2006, at 4:25 pm)

    Hi pepemazas,
    It’s hard to know what you mean without seeing the code, but you can email it to me via the Contact page on this site if you like and I’ll take a look.

    In terms of editing the text that is displayed, you would need to edit the plugin code slightly. On line 225 of the plugin you will find the following:

    echo '<div class="rating-container"><div class="rating '.$rating_class.'">Rating: '.$get_rating.'</div></div>';

    You can replace “Rating: ” with any other text you would prefer. This is probably easier than trying to add other text before and after the default plugin code. I might look at a way of making it easier to specify this text, maybe from the options page.

    Hope that helps :)

  10. SirCom said: (on June 2nd 2006, at 1:57 pm)

    Thank you, Mike! This is exactly what I need.

    I am planning to extend it a little bit such that I can generate a list of posts that are, say, having 3 stars or above. Do you think it is difficult? Or have you considered doing that? Or better yet, implemented it already?

  11. Mike said: (on June 2nd 2006, at 6:22 pm)

    Hi SirCom,

    Yes, I definitely considered doing that. Ideally I wanted to be able to order posts by rating as well (highest to lowest or vice versa) but didn’t have the time to persue it.

    I don’t think it would be very difficult — it’s just a matter of writing a function that makes the right type of calls to the database and filters using the custom ratings meta data.

  12. Hungry Chicken said: (on July 2nd 2006, at 7:14 pm)

    hi! thanks so much for the great plug-in! it works perfectly and easily!

  13. dan said: (on July 29th 2006, at 6:47 am)

    hey - does anyone know if this works for comments as well??? i’ve implemented it for standard posts (works great!), but i’d also like to be able for commenters to supply a rating as well (much like amazon’s comment/rating system)…


  14. amar said: (on August 20th 2006, at 2:16 pm)

    Great work
    but why you do not just add a column to a “wp_posts” table and store the rating value in it?.

    thanks agin

  15. Mike said: (on August 20th 2006, at 7:52 pm)

    I prefer not to mess with the structure of the WP tables, and instead use what is already there. When I was lookng at building the plugin it seemed fairly common practice to store plugin data in the meta table, and really the rating IS meta data of a sort in my opinion, so it made sense to me.

  16. Woody Sabran said: (on August 23rd 2006, at 7:12 am)

    Plug-in rocks, thanks a lot! Would really, really like the ability to show a list of top-rated posts… would much appreciate it if you could get this feature working!!!

  17. Lara said: (on August 26th 2006, at 3:17 am)

    Hi there - I absolutely was thrilled to find this plugin for a project I’m working on - however I really need to be able to sort the output from highest rated to lowest.

    I know you said that you’d considered it but didn’t have the time to put into it… is there any chance you might work on that anytime soon, or could possibly help me with configuring it to do so? I’m NOT a programmer, and know nothing about writing functions or anything like that.

    The way the site is set up now is using archive pages to list posts out ONLY. I have 4 main categories and 4 subcats within each main. This particular situation might be a bit more complicated than the average WP install, as we’ve got a lot of custom queries being used (my programmer is currently very busy, otherwise he’d be working on this for me!) and I kind of need some site-specific help with this. I’d be more than willing to give a decent donation for this sort of customization if you could help me with it.

    Thanks for a great plugin regardless, though. I just can’t use it unless I have this specific functionality to it. :)

  18. Kate said: (on September 9th 2006, at 7:20 pm)

    Great Plugin!

    Is it possible to echo “Rating: None” if admin decides not to rate a post? I use a global single template for multiple cats and some content doesn’t require rating. I’ve checked out your plugin, but I’m not quite sure where exactly I can insert “None” to produce a NULL rating score.

    Thanks for sharing!

  19. Andrew said: (on September 13th 2006, at 1:52 pm)

    Hi Mike, any idea where i could get a plugin that allows the reader to vote on a post ?? Only one I found was in spanish. Thanks!

  20. Artsi said: (on September 16th 2006, at 12:53 am)


    I have installed your plugin but have failed to get it into the templates. I’m too green with WordPress. Could you please define more precise which file I should edit and give an example where in it.


  21. Artsi said: (on September 16th 2006, at 1:03 am)

    Ahh. got it now. I need to put it inside my current Theme, for eg. posts.php. Seems now to work OK. Thanks for the plugin!

  22. Mike said: (on September 16th 2006, at 9:17 pm)

    Hi all. Sorry for the delay in replying to comments, but I’ve been traveling overseas with limited internet access for the last few weeks :)

    Kate: This would be easy enough — all you need to do is edit the code where you call the plugin so that it is something like this:

    <?php if (function_exists('has_rating')){
      } else {
        echo "Rating: none";

    Andrew: I have definitely seen something like this in action, but off the top of my head can’t remember where. Have you tried the WP-plugins site? It’s a good place to start looking — try a search for ‘rating’ on there (I just took a quick look and there were quite a few results)

    Artsi: Glad you got it working! I hope it suits your needs and proves useful :)

  23. Kate said: (on September 25th 2006, at 2:24 pm)

    Thanks Mike - your mod worked like a charm!

  24. Andrew said: (on September 29th 2006, at 9:05 am)

    Hey Mike, I found a great plugin … just what I was after. Its on my site www.musthave.co.nz … its called wp-postratings by gamerz.

    thanks, Andrew

  25. Eric said: (on December 7th 2006, at 12:54 am)

    Would it be possible to show the latest posts on another page in order of rating?

    Wordpress powers a news portion of our site, and currently the home page uses get_posts to get the 4 latest posts, as sorted by descending date. Since the ratings are stored in the_meta, I don’t think they’re accessible in that command, and anyway you’d want still want it to descend by date. That is, today’s posts by descending rating, then yesterday’s by rating, etc.

  26. Eric said: (on December 7th 2006, at 12:57 am)

    A note: The desire is to show only a few “featured” news headlines on the home page, to keep it uncluttered, out of what might be anywhere from 5 to 30 news items each day.

  27. Richard said: (on February 16th 2007, at 12:13 am)

    Feature request (I can but try) : would it be possible to be able to rate several items at a time per post?

    Decor: 5
    Amenities: 3
    Distance to coast: 4

    That sort of thing.

    Here’s hoping!

  28. LilAcorn said: (on February 16th 2007, at 12:45 am)

    I have added this to my wordpress blog but my version is the newer one… 2.1 The Loop stuff is waaay over my head as for a beginner…

    I also wonder if this can be done for those who like to comment. This way that my readers who has seen such movie/TV series can do their share…

  29. Mike said: (on February 16th 2007, at 12:58 am)

    @Richard - It’s definitely possible, but it’s unlikely that I will implement it for this plugin as the intention is for it to be very simple. There are more complex plugins out there that may handle this type of thing for you :)

    @LilAcorn - similar to my above comment for Richard, the plugin is pretty simple by design, so doesn’t currenlty support ratings for commenters. I’m pretty sure I’ve seen sites that do it, so it’s likely there is another rating plugin for it. I haven’t had a chance to get into WP 2.1 yet, so let me know if you have any trouble with the plugin on your blog.

  30. LilAcorn said: (on February 18th 2007, at 11:05 am)

    Im not getting anywhere ive activated the plugin tried the find the “loop” in all of my wp files… cant find it anywhere and it is very annoying now. I really do not think this is simple. unlike the calander archive plugin. This would be great if was more clearly explained on which file(s) to edit to paste the code…

  31. Mike said: (on February 18th 2007, at 12:08 pm)

    @LilAcorn - Take a look at the page about the Loop on the Wordpress site. It explains what it is. Basically, most of the code that handles the display of your posts for your template will be within the loop, so try throwing the code anywhere in there.

  32. CB said: (on February 24th 2007, at 12:15 pm)

    Anyone got this working in WP 2.1?

  33. Mike said: (on February 24th 2007, at 1:08 pm)

    @CB - I’ve got a copy working with 2.1 locally on my laptop, and it seems to be fine. I’m in the middle of converting this whole site to 2.1 and so far there have been no issues I’ve found with the plugin. If anyone finds any I’d love to hear the details.

  34. Thomas said: (on February 24th 2007, at 2:33 pm)


    I love your plugin. Simple, clean and efficient. However, I’m having a few problems with using CSS to display the ratings. I don’t know what I’m doing wrong.
    When I set the plugin to use image files everything prints out okay, but using CSS only prints the text.

    Got any ideas?


  35. Mike said: (on February 24th 2007, at 11:32 pm)

    @Thomas - Without seeing an example it’s hard to know exactly what is going on. If you want to email me via the contact form on this site, and provide a link to where you are trying to use it (or the source code from the page) then I can try and help pinpoint what the issue is :)

  36. CB said: (on February 25th 2007, at 2:30 pm)

    It’s working! To help LilAcord, here is what i did:

    Upload plugin and activate it. Enter the code as described into index.php (of your theme folder). Login as admin and go to Options -> DS-Rating options. Tick/select Image Files and at the bottom, in Path to image files: make sure the path to the images are correct.

    Thanks Mike, this plugin is excellent.

  37. LilAcorn said: (on February 26th 2007, at 11:23 pm)

    Well I tried and I have not been able to get this going on my WP 2.1 blog so I am removing it… thx…. ill try to find something else that’s far more simple or just stick to the old way copy n paste my stars images till there is something FAR more simplier that does not require file editing. WP is far to complicated to me than Blogger that I am used to.

  38. m-alo said: (on February 27th 2007, at 11:23 am)

    Strange thing: I’m using WP 2.1, and the rating goes away whenever someone (including myself) leaves a comment on a post with ratings (The radio-buttons simply becomes “unselected” when someone leaves a comment!)

  39. Mike said: (on February 28th 2007, at 8:56 pm)

    Thanks m-alo, I’ll take a look as soon as I get a chunk of time free and try to fix it.

  40. madsh said: (on March 4th 2007, at 8:29 am)

    Great plugin Mike!

    I am currently trying to add a rating system to a wordpress 2.1 template, so I am keeping an eye on any updates…

    While you are coding anyway :-) I would like to vote for the feature to show a list of posts with a minimum rating. It will make a great sidebar! I was thinking about doing something similar with a ‘Custom field’ i.e. highlight, but looks like you got it right.

    If you need some testing let me know.

  41. Eli said: (on March 14th 2007, at 1:20 am)


    I’m having a similar problem with my 2.1.x install (here). I have noticed as m-alo described that the rating (and tags) will be erased whenever someone comments or tracks back.

    I also played around with a (star-based archive page.

  42. m-alo said: (on April 2nd 2007, at 5:50 pm)

    Please do something soon! It’s frustrating that my favorite plugin isn’t working properly. My code-skills isn’t good enough to fix it myself :(

  43. Mike said: (on April 3rd 2007, at 8:49 am)

    The fix is underway. Should be ready in the next week or so :)

  44. Rafmeister said: (on April 4th 2007, at 12:35 pm)

    Good to see this plugin being supported so well, really looking forward to the fixed version for 2.1.x.

    KUTGW Mike ;)

  45. m-alo said: (on April 6th 2007, at 12:58 pm)

    Thanks for the update, but I’m getting an error:

    Warning: Missing argument 1 for get_rating() in /[my path stripped out]/wp-content/plugins/ds-rating.php on line 179

    The rating does show, but the error shows too…

  46. Mike said: (on April 6th 2007, at 9:20 pm)

    OK, I’ve just updated that line in the code so download the plugin again and give it a go. Let me know if the problem persists – I haven’t had any trouble here, but everyone’s install is customised differently ;)

  47. m-alo said: (on April 7th 2007, at 1:02 am)

    Thanks Mike, that did the trick!

  48. amar said: (on May 7th 2007, at 5:21 am)

    thanks, but this plug in don’t work correctly with IE!?
    can you fixed that pleases ..

  49. amar said: (on May 7th 2007, at 5:39 am)

    the deital here
    when I use IE to add a post and add some rating nothing added to databases but when I do the same action from Firefox every thing happen correctly ..

  50. Mike said: (on May 7th 2007, at 11:50 am)

    Hi Amar,
    I have no problems with IE7, but can’t check it in IE6 just at the moment. I’ll look into it as soon as time allows.

  51. Christo de Klerk said: (on June 22nd 2007, at 6:26 am)

    Interesting, I’m using wordpress 2.2 - the problem seems to be back: comments erase ratings.

    Otherwise, this is a really nifty plugin - clean and well executed.

  52. Doug said: (on July 3rd 2007, at 2:31 pm)

    Hi, I’m able to show th individual ratings for posts, however, when I try my rated posts I get this error:

    Fatal error: Unknown function: list_rated_posts()

    Anyone else get this error?

    Thanks. D./

  53. Doug said: (on July 3rd 2007, at 3:01 pm)

    BTW I’m using wp 2.2.1.

  54. Sean said: (on July 4th 2007, at 8:54 am)

    Is anyone having problems using png images with this plug in?

    I’m trying to create some new graphics and want to use png (transparency rules w/ png images).

    Thanks for this great plug-in! It makes reviewing albums easy!


  55. Leland said: (on July 8th 2007, at 2:26 pm)

    I am having trouble figuring out where exactly to put the post code.

    I am new to wordpress but not to web coding. I can see my theme pages and edit the code but for whatever reason when I put in the post code list above I still don’t see the stars

  56. Leland said: (on July 9th 2007, at 4:08 pm)

    I got the plugin working however I am running into one issue. When I make a post the stars show up wherever I post the code, however if I go back to edit the post I have to re-input the rating as it isn’t saved for some reason.

  57. Mike said: (on July 9th 2007, at 4:13 pm)

    @Leland: What version of Wordpress are you using? It sounds like there may be issues with the new 2.2 version, but I haven’t had a chance to trouble-shoot it yet.

  58. atroxi said: (on July 12th 2007, at 7:13 pm)

    I too am having the “comments wipe out the ratings” issue…currently, I’m on version 2.2.1 and don’t mind being a guinea pig!

  59. Daniel said: (on July 26th 2007, at 3:07 am)

    I am having trouble with the <?php list_rated_posts('', '', '10', 'rated_high', FALSE); ?> When I drop it into my sidebar (or the into my index within the loop for that matter) all I get is an error: Fatal error: Call to undefined function: list_rated_posts() in /wp-content/themes/bestdesignbooks/sidebar.php on line 31
    Line 31 is the list_rated_posts

  60. Hostimal said: (on July 27th 2007, at 7:44 am)

    Thanks, thanks, thanks, finaly rate plugin where I can choose ID of post.

  61. Mike said: (on August 4th 2007, at 8:01 am)

    Hi all,
    For those having troubles, please make sure you have downloaded the most recent version of the plugin. I just found out that one of the download links was still pointing to the older version. The zip file you donwload should be titled ‘ds-rating-v1-1..zip’.

  62. Bryc said: (on September 3rd 2007, at 4:16 pm)

    Thanks Mike for the fantastic plugin. Everything is working great for me. I run a movie review blog in which I also rate the movies based on your plugin. For my blog, after readers read my review of the movie they can then comment and leave their own review. I was wondering if there might be a way to incorporate the same rating system that is in the write post section to the comments.php? That way the commentators can rate the movie as well and they will appear as the same looking stars. Thanks again!

  63. aca463 said: (on September 6th 2007, at 3:23 am)

    Este plugins necesita tener activados los widget en el themes?
    Saludos y muchas gracias.

  64. Ivy said: (on September 20th 2007, at 10:11 pm)

    Hi, nice plugin. I recently downloaded it and it works perfectly. I just want to ask if it’s possible to put this in my sidebar?

  65. Mike said: (on September 20th 2007, at 11:05 pm)

    Hi Ivy,
    Glad you like it! You should be able to put it in the sidebar OK, but you will need to either set up a new Loop (see the Wordpress Codex for info on Loops) or else customise your PHP to pass an ID to the function for each entry you want to output the rating for.

  66. edoriv said: (on September 23rd 2007, at 5:28 pm)

    Everything is in place and working however. Nothing shows when set to use css if you view the source of the page you do see

    <div class="rating-container"><div class="rating four">Rating: 4</div></div>

    if I set to use images instead it shows text but no images.

    paths are correct…

    any clue?

  67. daniel said: (on October 20th 2007, at 2:38 pm)

    Is this plugin compatible with WP v. 2.3? If not, when will it be made compatible? Thanks.

  68. Tom said: (on November 25th 2007, at 11:50 pm)

    Great plugin!

    But i was wondering if it is possible to use 10 stars instead of 5? Is this difficult to do?

  69. Mike said: (on November 26th 2007, at 7:26 am)

    Hi Tom,
    You can do it, but it would involve hacking the PHP in the plugin. It’s not hard if you are familiar with PHP - others have done it in the past - but if you are not, then sorry but it’s not something you can set easily using options or anything.

  70. strike said: (on December 5th 2007, at 1:24 am)

    I’m glad someone wrote a plugin like this. The only problem is that I can’t make it work for my site.
    It should show the stars in the post’s title bar right below the category || date.
    Nothing happens! I already tried to change the pictures from black to gold but that was useless.
    Please help!

  71. Mike said: (on January 5th 2008, at 1:38 am)

    Hey guys,

    I’m having some trouble getting the plugin to work also. It installs fine, yet I can’t seem to get it to display.

    I’ve edited the index.php file and added the code in the loop, yet nothing appears. :(

  72. Mike said: (on January 5th 2008, at 1:42 am)

    Ah! Ignore my last comment. I managed to get it to work. It seems it wasn’t adding the ‘ds-rating-v1-1′ filepath.

    Added that in the options and it works fine now.

  73. Jeanne said: (on January 12th 2008, at 3:48 pm)

    I am having some trouble with the list_rated_posts option. Even though I ask it to sort by highest rated, it always seems to return the list in order by post_date. Also, posts that have no rating are showing up in this list with 5 star ratings. Take a look over on http://www.booksforears.com — see the ‘Top Rated Audio Books’ section on the right sidebar.

    Thank you for your great plugin - I feel like I am so close to exactly what we need!

  74. Jeanne said: (on January 12th 2008, at 4:08 pm)

    Ah.. upon more reflection, I think the problem is that unrated posts show up as 5 star posts at the bottom of the list (though in the right position). We can rate all our posts (as a work around) - but I think I may also want to know if I can modify the code so that it sorts within the list of 5 star posts to show the most recent posts at the top of the list (rather than keeping the oldest 5 star post at the top of the list forever). Thoughts?

  75. Yurem Weiland said: (on February 6th 2008, at 4:21 am)

    Pluggin does not works…. :(

  76. Mike said: (on February 7th 2008, at 6:37 am)

    @Yurem: what problem are you having? It works for everyone else…

    @ALL: I have just updated the plugin to fix a couple of bugs with the list_rated_posts function mentioned by @Jeanne above, so please download the latest version.

  77. Jon said: (on February 21st 2008, at 6:44 pm)

    Hi Mike,
    Thanks for a great plugin. I had tried about 5 different rating plugin, all with a features I didn’t need and countless problems before I finally discovered yours.

    I have changed the size of the stars in photoshop to have them about double the size and made changes to the css in order for them to show properly. I was wondering if it’s possible to have 2 different size at once. Like a bigger size for the post and a smaller size for my sidebar?

    Would you be kind enough to run me thru the changes I would have to make (either in the ds-rating.php or in the css class.

    Thanks Again,

  78. oz said: (on February 21st 2008, at 7:56 pm)

    I’m having problems. The first post, it works, but every post after that I see, “This entry has a rating of” thats it.

  79. Mike said: (on February 21st 2008, at 9:53 pm)

    @Jon: you should be able to use CSS to style two separate sizes on one page. Because the images are all specified using CSS, all you need to do is create the images for the two sizes, then target the rating classes according to where they are nested in the page (e.g. #sidebar .rating-container), specifying the different images for each.

  80. Kolo said: (on March 1st 2008, at 8:12 am)


    I using this plugin on my 2.3.2 wordpress and when trying to activate it gives an fatal error.. is this version not compatible to the latest wordpress version?

  81. Mike said: (on March 3rd 2008, at 9:56 pm)

    @Kolo: I haven’t given the plugin a thorough test in 2.3.2 yet. It was most recently tested for 2.2 and things were all working fine. When I get the next chance I’ll check it all out.

    EDIT: I just had a quick look at 2.3.2 and didn’t get any errors like you describe. Is there any other info you could give me? Was it on a fresh install, or did you upgrade an existing site?

  82. shabooty said: (on March 28th 2008, at 8:05 am)

    cool i will def try this plugin and tell ya how it goes.

  83. Dan said: (on April 23rd 2008, at 2:51 pm)

    How hard is to make this work in a page? instead of a post? So you could rate the page. (I use my wordpress as CMS and sometimes I use pages instead of posts to choose the template.)

  84. Mike said: (on April 24th 2008, at 7:09 pm)

    @Dan: The ratings are stored as metadata, and I don’t see why you couldn’t store metadata against pages in the same way as posts. To be honest though, it’s not something I’m looking at adding (or have the time to add!) so you might need to delve into the PHP yourself for that one sorry :)

  85. palavrazzi said: (on May 22nd 2008, at 1:57 am)

    Hello ther, where is the loop i can’t put the
    ds-rating to work.

  86. DanGarion said: (on June 10th 2008, at 9:56 am)


    I was wondering if you have put any thought into making it so one could put the rating, inside the actual post, instead of having it outside of the post in the loop?

    I really like this rating plugin, compared to the one I had been using, but I’d love to be able to ad a code tag like {rating} that would show it in a specific location instead of out of the post…?

  87. Mike said: (on June 11th 2008, at 12:42 am)

    @DanGarion: I can'’t say I’ve ever thought of (or needed) that kind of option — out of interest, what sort of situation would you have where you needed to embed the rating within the post content?

  88. DanGarion said: (on June 11th 2008, at 4:00 am)


    To answer your question. I do a restaurant review website and I embed the rating within the post itself as show here


    The current plugin I use, does the job but the person no longer supports it, so it’s sort of scary to use sometimes because of some of the funky things it does in 2.5. (it started adding customer fields to every post, even those without a rating on them) so I found yours which looks a lot more stable.

  89. James Beechinor said: (on July 16th 2008, at 1:34 am)


    Great plugin, really good stuff.

    I’ve set up two styles to put different size ratings into a sidebar and into a post. I’ve created two sets of on/off images and put them into the “black” folder and “gold” folder (black for big, gold for small).

    The sidebar one works perfectly.

    The post one pulls in the correct size images, but seems to be using the CSS sizing from the smaller images. So, something that has four stars, looks like it’s only got two (although it shows it as having four stars in Admin and in the sidebar)

    I’ve copied the CSS below.

    Any ideas?

    .rating-container {
    	height: 25px;
    	width: 142px;
    	background: url(.../wp-content/plugins/ds-rating-v1-3/ds-rating-images/black/rating-off.gif) no-repeat;
    	overflow: hidden;
    	float: left;
    .rating {
    	padding-top: 25px;
    	height: 0px !important; 
    	height /**/:25px; /* for IE5/Win only */
    	background: url(.../wp-content/plugins/ds-rating-v1-3/ds-rating-images/black/rating-on.gif) no-repeat;
    	text-align: left;
    	overflow: hidden;
    .zero { width: 0px; }
    .zero-and-half { width: 13px; }
    .one { width: 26px; }
    .one-and-half { width: 42px; }
    .two { width: 56px; }
    .two-and-half { width: 71px; }
    .three { width: 85px; }
    .three-and-half { width: 100px; }
    .four { width: 115px; }
    .four-and-half { width: 129px; }
    .five { width: 142px; }
    #sidebars .rating-container {
    	height: 12px;
    	width: 64px;
    	background: url(.../wp-content/plugins/ds-rating-v1-3/ds-rating-images/gold/rating-off.gif) no-repeat;
    	overflow: hidden;
    	float: left;
    #sidebars .rating {
    	padding-top: 12px;
    	height: 0px !important; 
    	height /**/:12px; /* for IE5/Win only */
    	background: url(.../wp-content/plugins/ds-rating-v1-3/ds-rating-images/gold/rating-on.gif) no-repeat;
    	text-align: left;
    	overflow: hidden;
    .zero { width: 0px; }
    .zero-and-half { width: 6px; }
    .one { width: 12px; }
    .one-and-half { width: 19px; }
    .two { width: 25px; }
    .two-and-half { width: 32px; }
    .three { width: 38px; }
    .three-and-half { width: 45px; }
    .four { width: 51px; }
    .four-and-half { width: 58px; }
    .five { width: 64px; }

  90. Mike said: (on July 16th 2008, at 8:59 am)

    Hi James,
    I’ve sent you an answer via email for that one :)

  91. Erick said: (on July 20th 2008, at 6:17 pm)

    Hi. I want to try this plugin. It’s installed and I have added a line to my Single Post inside the loop.

    Then I went into a post and enabled a rating of 5. Next, I go into my blog to see that page, I refresh it a few times, but I see nothing at all.

    Your installation steps do not mention anything other than the above. What am I missing?


  92. Erick said: (on July 20th 2008, at 6:19 pm)

    Also, is there a way to enable the plugin for many past posts at one time?

    (Your blog does not have “Subscribe to comments” feature, so please email me if you reply here. Thanks!)

  93. James Beechinor said: (on July 24th 2008, at 7:15 am)

    Mike - thanks for that other fix.
    Another one – the list_rated_posts function - it’s pulling in posts that are scheduled for the future. We have a post schedule to go live next Monday, but it’s showing on the sidebar now. Any ideas? Other than make the post “unpublished”?

  94. Jb said: (on August 9th 2008, at 8:58 pm)

    Hi, The plugin seems to display post revisions since WP 2.6.

    See on this page :


  95. Jb said: (on August 30th 2008, at 3:02 am)

    To debug the display of list of rated posts in WP 2.6 (which displayed the revision posts), you have to modify line 261.

    From :
    $rating_query .= "WHERE meta_key = '_ds_rating' ORDER BY ".$orderby." ".$ordertype.", post_date DESC";

    TO :

    $rating_query .= "WHERE meta_key = '_ds_rating' AND $wpdb->posts.post_type = 'post' ORDER BY ".$orderby." ".$ordertype.", post_date DESC";

  96. Jb said: (on August 30th 2008, at 5:27 pm)

    Even better with:

    $rating_query .= "WHERE meta_key = '_ds_rating' AND $wpdb->posts.post_type = 'post' AND $wpdb->posts.post_status = 'publish' ORDER BY ".$orderby." ".$ordertype.", post_date DESC";

    (avoid showing scheduled and draft posts)

  97. Johannes said: (on September 3rd 2008, at 11:34 pm)

    Thanks for the great plugin! :-)

    Just wanted to mention three items on my wish list for the plugin: *g*

    Integration with WordPress’ role system. I use the plugin on a blog with several contributors, and I’d like to define who of them can see the ratings on the “write post” screen and who not.

    Make the number of stars flexible. We use a “x out of 10″ rating system. That’s actually easy with the CSS method, you just have to include the further CSS styles (.five-and-half to .ten) and the controls on the “write post” screen for it. I did this manually, but it would be nice to be able to chose the number of stars in the backend options (e.g. between 3 and 15). The code could use arrays internally to make this easier.

    Make the title of the stars configurable in the CSS method. With the CSS method, there is no title attribute on the div currently. I’d like to be able to input a String like “average group rating [rating]/10 stars” in the options for display as the title attribute.

    Contact me if you would except any contributions for these points. Not that I have much free time, but I could try wish #1 and #3. :-)

  98. Terry said: (on October 8th 2008, at 6:27 am)


  99. Tom said: (on October 15th 2008, at 8:26 am)

    After installing this, I don’t see anything showing up for any posts. The code is indeed inside the loop and the plugin is active. I am on 2.6.1.

    Does it not show up because the current posts have no rating? In the write post, I do see the ratings interface, so it is there. I did add the code change above on line 261.

  100. Martin said: (on October 15th 2008, at 3:08 pm)

    Hi i want to add before the star a little text.

    Like this: Cote MB ***

    how i can add this

  101. mugger said: (on November 1st 2008, at 6:49 am)

    In WP 2.6.1 to .3
    I inserted your first code of “Displaying the rating”

     <?php the_content(__('(more...)')); ?> 
    <!-- Insert for DS rating -->
    <?php if (function_exists('has_rating')){ if(has_rating()){ get_rating(); } } ?>

    enabled plugin, accepted default of CSS, updated a post, saved, and 1. no rating appears,
    2. return to post edit shows rating was not saved.

  102. Erick said: (on November 10th 2008, at 4:53 pm)

    There is no “Notify” for comments on this blog, so please send me a CC if you respond.

    My question: how can I use stars not from 0 to 5, but from 0 to 10? Thanks.

  103. Paid Survey Reviews said: (on November 20th 2008, at 2:41 am)

    This plugin is just great. I wish I could have found it before I published this site. I am now planning to use it for my new affiliate site. Thanks !

  104. New York Web Design said: (on November 25th 2008, at 5:54 am)

    Is there a way to rate it with some smilling images (up to 5) and show the result (rating average) in a progress bar?

  105. Sam C. said: (on December 1st 2008, at 10:30 am)

    Has anyone found a way to use this system on PAGES? Thanks.

  106. edoriv said: (on December 29th 2008, at 5:04 pm)

    Hello i’m curious if there is a way to have preset links say placed in the side bar that will display all posts with X rating sort of like a preset search result.

    this also leads me to my second question would it be possible to add to the standard search parameters to return search results that also have a rating of X or better?

    thanks for any advice you can provide

  107. daddy design said: (on January 15th 2009, at 9:28 pm)

    HI.. I have been looking all over for a plugin like this. So We were wondering 2 big editing questions that we dont know if there possible to do. 1. Can the rating be form 1 to 10? and 2. Can we display the rating as a number instead of stars?
    please let us know…

  108. JD from Earvolution said: (on January 26th 2009, at 6:50 am)

    Would love to talk to someone about installing this (or something like it) on a WP site for me.

    Can be reached at jd at earvolution dot com