Assign post numbers

<?php
//Add this above the loop in your template
if(is_paged()) $post_number = $wp_query->found_posts - ($wp_query->query_vars['paged'] -1) * $wp_query->query_vars['posts_per_page'];
else $post_number = $wp_query->found_posts;
?>

<?php
//Add this within the loop wherever you want to print the number
echo $post_number; $post_number--;
?>

0 Comments

You must be logged in to post a comment.