Forums

[Plugin: WP-PostRatings] Why "add_action('the_content', 'add_ratings_to_content');" is commented out (2 posts)

  1. mocheng
    Member
    Posted 2 years ago #

    I installed plugin wp-postratings 1.5 (http://wordpress.org/extend/plugins/wp-postratings/), but the rating stars doesn't show up in my post.

    I checked the code in wp-postratings.php.

    ### Function: Add PostRatings To Post/Page Automatically
    //add_action('the_content', 'add_ratings_to_content');
    function add_ratings_to_content($content) {
    	if (!is_feed()) {
    		$content .= the_ratings('div', 0, false);
    	}
    	return $content;
    }

    After I un-comment the statement "add_action('the_content', 'add_ratings_to_content');". The ratings UI is displayed.

    I am wondering why this statement is commented. Without this statement, this plugin doesn't actually take effect since no UI for visitors. Or, is there any other way to show the ratings UI?

    Thanks.

  2. Lester Chan
    Member
    Posted 2 years ago #

    Did you read the readme.html and note the tabs on top?

    You are suppose to add in the code. I commented that part out because it will fix the postratings display to after the content and that does not give the user the flexibility to place the ratings wherever he wants

Topic Closed

This topic has been closed to new replies.

About this Topic