I have a query that gets the 5 highest rated content on my blog how can i make it so for each post that is shown with the query 1 is added to the a $number variable?
Basically what i want is to give the highest rated content a number between 1-5 the first gets 1 the second get 2, third get 3 and so on.
<?php ( query_posts('category_name=music&showposts=3&orderby=comment_count&order=desc&post_status=future,publish') ) ; ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
Try this – just set $number to 0 and then use ++ to increment the number,