Most popular posts using views post meta

A few days ago Bob posted a comment asking about using the post views snippet to display the most popular posts. So here it is! place this snippet just before the loop within the index.php template and wordpress will use the post views to order your posts from highest to lowest. Don’t forget that for this to work you will need to setup the post views snippet.

 

 

<?
query_posts('meta_key=post_views_count&orderby=meta_value_num&order=DESC');
?>

 

Leave a comment