There is – check out the documentation 🙂
Regards,
Blaz
Hi Blaz,
i have checked out documentation but I am not able do get it working
I have tried to use this:
$post = get_post( $post_id );
echo Rate_My_Post_Public_Helper::get_visual_rating($post );
but nothing is displayed.
Regards
ad
@adesigno,
you were close 🙂 So, if you want to list ratings for all posts, you first need to make a loop: https://developer.wordpress.org/themes/basics/the-loop/
Something like this should work:
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
the_title( '<h2>', '</h2>' );
echo Rate_My_Post_Public_Helper::get_visual_rating();
endwhile;
else:
_e( 'Sorry, no posts matched your criteria.', 'textdomain' );
endif;
?>
Note that the stars will be without style and if post has no ratings the method will return false. This will be handled differently in version 3 which is being developed and will be released in early 2020.
Blaz