Advanced: Changing the Position of User Ratings Form

As we saw earlier, the user ratings form is below the comments form — not good.

Ratings in comments

We want to place this above the comments fields.

Good position of comments ratings form

This is a bit tricky. We will have to utilize WordPress hooks.

So, to do that, first, we turn off the automatic embed for the comments form that we did earlier.

Then open functions.php of our child theme and add the following PHP code to it:

add_action('comment_form_before_fields', 'insert_myrp_rating_form');
function insert_myrp_rating_form()
{
	global $post;
	myrp_api_ratings_form_table($post->ID);
}

Unfortunately, knowledge of WordPress API and MyReviewPlugin API is mandatory for a tweak like this.

But hey, with this or without it, we built a great review site in this tutorial, wouldn’t you agree?!

Thanks to MyReviewPlugin and its amazing ability to make building review site so easy for anyone — even for someone who doesn’t know much about building sites!!

Leave a comment

Your email address will not be published. Required fields are marked *

*

Read this to make your comment cool.