2012-09-13 25 views
6

¿Cómo obtener la publicación actual index number dentro del bucle WHILE?Wordpress: obtenga el número de índice current_post en el bucle 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; 

Han intentado con lo siguiente, pero sin resultado.

$index_query->post->current_post; 

¡Sugerencias muy apreciadas!

Respuesta

Cuestiones relacionadas