Web Tips
Sharing our knowledge of CFML & jQuery and many other web development tips.
Sharing our knowledge of CFML & jQuery and many other web development tips.
We have improved the plugin so that you no longer have to modify your templates. As was pointed out to us, our old method used in contestant-rating plugin was not flexible and would result in a broken theme if the plugin was deactivated. The new plugin now requires only that you place the following code in your post/page. You can pass the attribute star_type to the handler. The two current options for star_type are star and abuse. If no attribute is passed, the handler defaults to star.
[five-star-rating star_type=”abuse”]
That’s it!
Although you can load jQuery in the head section of the template, the plug in will try to detect if jQuery is loaded. If it does not detect jQuery, it will use the default jQuery that WordPress is using.
If you run a site with 2500+ articles, you really don’t want to go through and add the shortcode to every page. Can I just embed this into my template?
The simple answer is yes. Just add the following code to your template where you want it to appear:
<?php echo five_star_rating_func('star'); ?>
No, not right now. We are looking into this feature request and will continue to look into incorporating it into the plug-in.
With that said, there is still one option available to you that will allow you to shows multiple star ratings on a category page.
We suggest that you create individual posts and use the short code on each post. You can then assign the posts to a category to group them. For this example, we will use the category of mascots.
You create several different posts for each mascot and add your short code to the pages. Each mascot post you give the category of mascot. You can then view that category and each post will appear on that page with the rating. It would be a link like http://www.your-domain.com/category/mascot/
You need to simply add your images and change the CSS. Any size changes would need to be addressed in the CSS.
The plugin should be visible to anyone that has access to the page. There is no setting that would hide the plug-in on the page. If users are not allowed to vote, it is likely a cookie issue on their browser (check expiration).
You can customize it how ever you like with the CSS. Hint: The plugin is built in a container with class name of .FSR_container. You can change the margin from ‘margin: 1.5em auto;’ to something like ‘margin: 1.5em 0;’ in the CSS file.
We have tested the plug-in in several different browsers and it does work. If you are having a problem, please follow these steps before posting that it is not working.
This plug-in does work in Chrome (see video below). If you are experiencing problems, then please see the FAQ above.