WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can i display in a archive themplate ( post type) page a number of post,

Let say i want to display a number of 20 post....in archive page, under i want to display the pages...

Please look here :


I use post type pages... all the archive pages are now displayng 12 post..

I want to be able to display a number...

let say 20 post for trailers - for the trailers category let say 10 post for actori- for actori category...

Now i use :

<?php is_tag(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

Thanks in advance

share|improve this question
up vote 0 down vote accepted

Just use the current_post property in the loop:

if ( have_posts() )
    while( have_posts() )
        global $wp_query;

        // Show current post number:
        echo $wp_query->current_post;

    } // endwhile;
} // endif;
share|improve this answer
thanks for that – Batman Sep 27 '12 at 22:41
@CopilFlavius If it works - please mark it as answer. – kaiser Sep 27 '12 at 22:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.