1

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?

2

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

<?php
while( have_posts() ) :
    the_post();

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

endwhile;
?>
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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