The issue here is that you can assign reviews to anything with a Post ID. And while a review is a specific post type that Site Reviews can style in an opinionated way, other post types are very specific to your website design and everyone would require this ranked “list” to look differently on their website.
For this reason, I prefer to only provide the meta_keys for sorting by rank. This allow anyone with a basic knowledge of WordPress theming to do it themselves with a custom WP_Query which is pretty standard for WordPress.
Site Reviews also provides a glsr_star_rating()
function so that you can output the stars in the loop for each result:
$query = new WP_Query([
'meta_query' => [
['key' => '_glsr_ranking', 'compare' => '>', 'value' => 0],
],
'order' => 'DESC',
'orderby' => 'meta_value_num',
'post_status' => 'publish',
'post_type' => 'page', // change this as needed
'posts_per_page' => 10, // change this as needed
]);
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post();
$rating = get_post_meta($post->ID, '_glsr_average', true);
// print the page title
get_the_title();
// display the page rating
echo glsr_star_rating($rating);
}
wp_reset_postdata();
}