How to calculate post index when using offset in custom query
In your case, count would be offset + current_post: $my_query = new WP_Query( array( ‘post_type’ => ‘colors’, ‘posts_per_page’ => 5, ‘offset’ => 2 ) ); if ( $my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); echo $my_query->query_vars[‘offset’] + $my_query->current_post; the_title(); endwhile; endif; wp_reset_postdata();