I was looking for a post rating system for a while, then I stumbled across a great tutorial:
I have it working (well, its recording clicks ok), but I cannot seem to get a “most liked” page. The tutorial said to use the following code, so made a page, but nothing appears (apart from logo, nav, footer etc)
<?php
/*
Template Name: Top Rated
*/
?>
<?php get_header(); ?>
<?php query_posts('meta_key=votes_count&orderby=meta_value_num&order=DESC&posts_per_page=10'); ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Can anybody point me in the right direction? Thanks
EDIT: Thanks rizqy22, here is how the index displays posts:
`<a href="<?php the_permalink(); ?>"class="img_hover_trans"><?php the_post_thumbnail('featured-small'); ?></a>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>`
EDIT2: Made more progress, got the thumb, title etc displaying using the following code (just incase anybody else searches and finds my ramblings) <?php query_posts('meta_key=votes_count&orderby=meta_value_num&order=DESC&posts_per_pââage=10'); if (have_posts()) : while (have_posts()) : the_post(); ?> <a href="<?php the_permalink(); ?>"class="img_hover_trans"><?php the_post_thumbnail('featured-small'); ?></a> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php endwhile; endif; wp_reset_query(); ?>
Thats code just querying the posts by sorting it by meta value, but you have no loop for the posts to display. Add the loop after the query for something like this: