Get Post Index WordPress

<?php $i = 0; while ( have_posts() ) : the_post(); ?>
 <?php
 //do something
 $i++;
 ?>
<?php endwhile; ?>

Leave a Comment