While looking for a suitable solution for ratings for the Freeware Section on the site, it became apparent that there were no real solutions to allow multiple ratings on a single WordPress Page/Post. WordPress.com blog owners are lucky enough to have PollDaddy Ratings built in, but they haven’t released it on the WordPress Plugins Site just yet.
You may think “surely there are loads of ratings plugins you can use?”, I thought that too, and here is some that may turn up in your search results:
- GD Star Rating – Allows you to rate posts, comments, and make “multiple ratings” (no, not that type, simply 4 ratings in the same rater, if you know what I mean)
- Rate Anything! – Allows the author to create ratings, not the user.
- Blogarate User Style Rating Widget – Rates a Post
I could go on… and me and Dan spent well over 4 hours trying to find a solution to get multiple rating systems on just one page, either using services like Widgetbox or looking through custom coded things like the NoFunc Ajax Star Rating Script. Our search came to an end when we found the following:
ColorRating: http://colorpowered.com/colorrating/
This script allows you to put a nice looking 5 star script that uses SQLlite (no messing with phpmyadmin and creating databases and tables!) which looks like the following:
The instructions looked simple, but integrating them with WordPress was far more difficult (even when asking the author for help, he was not sure what to do). Lets run through the instructions:
Firstly, grab PHP Execution for WordPress. You’ll need this to invoke the rating in your post.
Note: You will need to use the editor to put the rating system on. Windows Live Writer (our blogging tool of choice) likes to mess with the PHP coding.
After unzipping the files and placing them in a folder called “rating” inside your template folder:
(the above shows an image to stop it executing in the post, grab the code here)
The first question here would be, “where do we put this code?”. After messing around for 20 minutes we found it best to put it in header.php in your templates directory just under the “rel” tags.
Next, change that rating.css, rating.js and rating.php to point directly to their destinations (e.g. http://yoursite.com/wp-content/themes/name/rating/rating.css), you’ll also need to head into the rating.js file and change to a direct link (just after “$.get”)
You may find at this point that you can only rate one star. This is because the links to rate are actually below each other. This is because (for some reason) the PHP execution, or something in WordPress decided to put random
tags after each hyperlink to rate. Simply open up rating.css and add the following line:
.score br{display:hidden}
You should now have multiple rating goodness! Next time you need to add a rating system into your page/post (replacing table name with your name):
Last 6 posts by DuncanM
- The iPad is… - June 30th, 2010
- Starting Out In Programming? Try Microsoft Small Basic - June 10th, 2010
- Miro Video Converter – Video Conversion Made (Too?) Simple - June 10th, 2010
- News: DuncsWeb Forum Open for Business! - May 23rd, 2010
- Black Aero Visual 7 Basic Style – Speed & Traditional Aero Looks in Windows 7 Basic - May 9th, 2010
Nice post. Brings back some memories. Thank god for FireBug!
Nice post. Brings back some memories. Thank god for FireBug!
this messed up my wordpress site at all, giving lots of erros
Hi this is killing me. I found your post after aboout 8 hours of trying to acheive this, but this just doesnt work, it refuses to work for me. I have followed to the tee. I then have tried to find a reason for it failing and added a seemingly miss php end tag to the php file, but nope, basically it just isnt working, and I wonder why I cannot see it on your site? is this because its stopped working for you?