When I use add_action( 'the_content'...
The content of the page just won't load. Also the content I am trying appears in all kinds of places in the page. Why?
Is there a way to force it to only appear under my post?
function __construct()
{
add_action( 'wp_footer', array(&$this, 'loadRatingsJs') );
add_action( 'wp_ajax_valnetincGetRatings', array(&$this, 'getRatings' ) );
add_action( 'wp_ajax_nopriv_valnetincGetRatings', array(&$this, 'getRatings' ) );
//add_action( 'the_excerpt', array(&$this, 'getRatings' ) );
add_filter( 'the_content', array(&$this, 'getRatings' ) );
}
public function getRatings($content)
{
//echo $postID;
if(function_exists('the_ratings')) {
/*if(is_null($postID))
{
the_ratings();
} else {
the_ratings('div', $postID);
}*/
$rating = the_ratings();
return $content.$rating;
}
}