2012-09-13 11 views
6

Jak uzyskać bieżący wpis index number w pętli WHILE?Wordpress: pobierz numer indeksu current_post w pętli WHILE

$index_query = new WP_Query(array('post_type' => 'post', 'orderby' => 'modified', 'posts_per_page' => '-1', 'order' => 'DESC')); 
while ($index_query->have_posts()) : $index_query->the_post(); 

    // echo current post index number 

endwhile; 

Próbowałem z następującymi, ale bez rezultatu.

$index_query->post->current_post; 

Wszelkie sugestie bardzo doceniane!

Odpowiedz