Title: Issue using glsr_star_rating() function
Last modified: April 25, 2022

---

# Issue using glsr_star_rating() function

 *  Resolved [p13patch](https://wordpress.org/support/users/p13patch/)
 * (@p13patch)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/issue-using-glsr_star_rating-function/)
 * I am trying to display a list of Posts that have a review. I’m using the function`
   glsr_get_reviews()` and then looping through each to get the assigned posts and
   display the post name. I want to display the review rating next to the post name.
   The review object gives the rating for the review as a number, and the documentation
   provided says that the function `glsr_star_rating()` should allow you to build
   a 1-5 star rating HTML string. I input the numeric value in the function, and
   in my dev tools it looks like all the HTML is there, but nothing is displaying.
   anyone else run into this or know what the issue might be?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/issue-using-glsr_star_rating-function/#post-15590396)
 * 1. A more efficient way to get rated pages is like this:
 *     ```
       $posts = get_posts([
           'meta_query' => [
               ['key' => '_glsr_average', 'compare' => 'EXISTS'],
           ],
           'orderby' => 'meta_value_num',
           'post_type' => 'page',
           'posts_per_page' => 10,
       ]);
       ```
   
 * 2. Looks like a bug. For now, try this:
 *     ```
       $rating = get_post_meta($post->ID, '_glsr_average', true);
   
       printf('<div class="glsr">%s</div>',
           apply_filters('glsr_star_rating', null, $rating)
       );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Issue using glsr_star_rating() function’ is closed to new replies.

 * ![](https://ps.w.org/site-reviews/assets/icon-256x256.gif?rev=3307009)
 * [Site Reviews](https://wordpress.org/plugins/site-reviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/site-reviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/site-reviews/)
 * [Active Topics](https://wordpress.org/support/plugin/site-reviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/site-reviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/site-reviews/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/issue-using-glsr_star_rating-function/#post-15590396)
 * Status: resolved