Automatically show WP-PostRatings on your posts

For the longest time, my Dragonskin Theme has had WP-PostRatings integration. Recently I removed the integration because it is easy to modify the rating plugin to accomplish the same goal. (I hope that in the future WP-PostRatings will provide a simple way to do this through the admin interface–it really isn’t that hard.)

All you need to do is open wp-postratings/wp-postratings.php and find a line that looks like this:

//add_action('the_content', 'add_ratings_to_content');

Simply uncommenting that line will put the post ratings at the bottom of every post and page. In Dragonskin, I only included it on posts and at the top. To achieve the same, make some modifications to the next block of code, so that it looks like this:


function add_ratings_to_content($content) {
if (!is_feed()|!is_page()) {
$content = the_ratings('div', 0, false).$content;
}
return $content;
}

  1. [...] Removed WP-PostRatings integration, integration can be done by editing the plugin [...]

Leave a Reply