• Resolved br3t

    (@br3t)


    Hello! First of all, thank you for your plugin, I use it on each my WP-site.

    I want to request additional function to get only rating-data of post. I need this to build my own microdata markup or show only rating without ability to rate post. Let me show my cases:
    1) I have a post-page with two blocks for rate this post. I also need microdata for Aggregate rating for this page. But if I check standart “Google snippet” feature in plugin options – I’ll see 2 agrragateRating-tags for my both rating blocks. It’s quite incorrect for microdata.
    2) I have category-page, where I want only show stars for each post without ability to rate it . AggragateRating also appears here for each post, it’s incorrect too.

    All I need is something like this:

    $rating = get_the_rating();
    print $rating['avg_score'];
    print $rating['users_count'];
    print $rating['max_rate'];

    Thank you!

    https://wordpress.org/plugins/wp-postratings/

Viewing 1 replies (of 1 total)
  • Plugin Author Lester Chan

    (@gamerz)

    1) the error will be fixed with the new version. Google did some change on their end
    2)
    get_post_meta($post_id, 'ratings_score', true )
    get_post_meta($post_id, 'ratings_users', true )
    get_post_meta($post_id, 'ratings_average', true )

Viewing 1 replies (of 1 total)
  • The topic ‘Get rating-data only’ is closed to new replies.