How to display average votes in posts?
-
I’ve tried the code below but it doesn’t show the correct average vote. It only shows a 0 digit.
<?php if(function_exists('the_ratings')) { the_ratings(); } ?> <?php echo intval( get_post_meta($post_id, 'ratings_average', true ) ); ?>
The star rating is working. After i click the star & rate it shows the correct values:
(2 votes, average: 3.00 out of 5, rated)
but i using the get_post_meta ratings_average, it just gives me a “0” digit.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to display average votes in posts?’ is closed to new replies.