• Resolved kword

    (@kw56)


    Great plugin!

    Can you please help me to get site_reviews_summary {num} to every assigned_posts without shortcode. I need the use number of reviews in my custom loop (cpt archive page). Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • echo glsr_get_ratings($args = [ 'assigned_posts' => get_the_ID()])->average;

    • This reply was modified 3 years, 2 months ago by pavel8289.
    • This reply was modified 3 years, 2 months ago by pavel8289.
    • This reply was modified 3 years, 2 months ago by pavel8289.
    Thread Starter kword

    (@kw56)

    pavel8289, thanks for your reply! But I need the number of reviews, not rating

    Plugin Author Gemini Labs

    (@geminilabs)

    This is the output of the glsr_get_ratings() function:

    So to get the number of reviews:

    if (function_exists('glsr_get_ratings')) {
        $summary = glsr_get_ratings([
            'assigned_posts' => get_the_ID(),
        ]);
        echo $summary->reviews;
    }
    
    Thread Starter kword

    (@kw56)

    Yes, it works! Thank you so much for quick help

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘get Reviews {num}’ is closed to new replies.