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

I'd like to make my most recent article display a large with a larger thumbnail and with more content, while the rest of the posts in the loop show a small thumbnail and only the title with no content.

Is there a way I can do this in one while(have_posts()) loop?

share|improve this question
up vote 2 down vote accepted

check the built in counter $wp_query->current_post within the loop:

while( have_posts() ) :

    if( 0 == $wp_query->current_post ):
        // this is the first post in the loop, output larger size, full content, etc.
        // output regular size, the_excerpt, etc.

share|improve this answer

I'm no wordpress expert but could you use 2 loops one showing the latest post and one showing posts after in order to have the different CSS?

So loop for most recent ...

    <?php $my_query = new WP_Query('showposts=1');
       while ($my_query->have_posts()) : $my_query->the_post(); ...

And the second loop (offsets the posts by 1)

    <?php $offset = new WP_Query('offset=1&showposts=5');
    while ($offset ->have_posts()) : $offset->the_post()...

You can change showposts=5 to show the number of posts you want in the remaining loop.

share|improve this answer

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.