Integrating Thesis with WPReviewSite

Post image for Integrating Thesis with WPReviewSite

Recently we moved the WPFloat.com site onto Thesis, our preferred WordPress theme platform.

WPReviewSite is the plugin that we use to allow users to rate and review WordPress designed sites, so we had to do some work on getting the two to play nicely.

Here are a couple of tips that we can share with you to get the plugin working, using Thesis hooks. This all assumes that you have the WPReviewSite plugin installed as well as the Thesis theme installed.

As usual, all of this codes goes into custom_functions.php in your Thesis custom folder.

Create a wordpress page to show your top rated

We wanted to be able to have the top rated table displayed on a page rather than on the home page of the site. To do this a create  page and take note of the page ID, in our case it was 2688.

Then write a function to see if the page being displayed is your target page. Use the ‘is_page()’ wordpress function for this, passing to it the page ID, then inside the function place ‘rs_comparison_table(5)’ this is a call to the plugin’s function to display the table.

The number you are passing to it (5) simply tells WPReviewSite how many top rated items to display.

function show_top_posts(){
// we have a special top rated page to display the top rankings
// so we check to see if we are this page to display the comparison table

if (is_page(2688)){

	rs_comparison_table(5);
}

add_action('thesis_hook_after_post','show_top_posts');

Add the ratings input area to your comments form

Next we wanted to add the input area, with the stars for people to be able to select while they were filling in the comments form. We can do this by adding the WPReviewsite code to the ‘thesis_hook_comment_field’ hook.

Have a look at the following example, note that there are two versions of the display, one prints a table while the other outputs a list.

function review_fields(){
//if (function_exists('ratings_input_table')) ratings_input_table();
// this is the table version use this in place of the list version below

print "Use the stars to rate this post, along with your comment.";
if (function_exists('ratings_input_list')) ratings_input_list(); print "Your email address will not be published";
} add_action('thesis_hook_comment_field','review_fields');

Finally some of the other functionality can be done without custom code, take a look at the screen shot below, it shows the WPReviewSite Settings that we have enabled.

Using these you can have the average ratings displayed on posts as well as show the ratings that are associated with individual comments, both of these work out of the box with Thesis.

WPReviewSite Settings

Useful links

Leave a Comment

Previous post:

Next post:

BROWSE BY TAG

(54) (32) (41) (25) (31) (72) (33) (25) (27) (23) (72) (34) (48) (50) (50) (25) (93) (23) (35) (25) (56) (88) (22) (73)