Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 :

http://cinema.trancelevel.com/trailer/aventuri/page/2/

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
add comment

1 Answer

up vote 0 down vote accepted

Just use the current_post property in the loop:

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

        // 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
add comment

Your Answer

 
discard

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.