Top Ratings Page/Post
-
Hi:
I don’t see the question here, so apologies if asked before:
Question: How to create a Top 25 List of post ratings on single page or post?
I want to use a similar functionality of the WP Ratings Widget on a single page/post, but see no instructions on how to do so. Thanks – Mike
It would look something like this:
TOP X RATINGS PAGE
Post Title 1 (2013) 8.1/11 votes
Post Title 2 (2013) 7.1/11 votes
Post Title 3 (2013) 6.1/11 votes
Post Title 4 (2013) 5.1/11 votes
Post Title 5 (2013) 4.1/11 votes
-
Not tested.
$the_query = new WP_Query( array( 'meta_key' => 'ratings_average', 'orderby' => 'meta_value_num', 'order' => 'DESC' ) ); if ( $the_query->have_posts() ) : <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2><?php the_title(); ?> <?php echo get_post_meta( get_the_ID(), 'ratings_average', true); ?>/11 votes</h2> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php else : ?> <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> <?php endif; ?>
Thanks, Lester. Where do I add this code?
On the page as page Template? http://codex.wordpress.org/Page_Templates
Please clarify. “On the page as page Template?”
Do I need to add code to a WP Ratings file or theme files, or ?
Thanks, Lester. Sorry, although I’m technical, I’m not a genius programmer such as yourself. 🙂
Yeap theme files.
If you still can’t figure you can hire a developer. I don’t provide support for modifications or additional stuff outside the base functionality that the plugin provide =)
- The topic ‘Top Ratings Page/Post’ is closed to new replies.