I file all the galleries on my blog under the 'gallery' tag. I use the following code (via) to display the latest 7 gallery posts after the 8th latest post on home page:
<!-- Featured post galleries after 8th post -->
<?php
$homegallery++;
if ($homegallery == 8){
?>
<!-- Display Gallery Posts -->
<div id="gallery-posts">
<?php
$count = 0;
$some_featured_posts = new WP_Query(array('category_name' => 'apps', 'posts_per_page' => 5));
while ($some_featured_posts->have_posts()):
$some_featured_posts->the_post();
$count++;
?>
<?php the_post_thumbnail( 'thumbnail' ); ?>
<?php
endwhile;
wp_reset_postdata();
?>
</div><!-- Display Gallery Posts END -->
<?php
};
?><!-- Featured post galleries END -->
As you can see, I use a thumbnail to represent each post <?php the_post_thumbnail( 'thumbnail' ); ?>
, may look weird, but that's how I do it. But I would like to show the thumbnails of first two posts in one size (large), the third one in one size (medium) and the rest in another size (thumbnail).
How do I do this?
In case it helps, I've got this far with some help:
<?php
$loop_first = 1;
if ( ! isset ( $loop_first ) ) {
// set featured image size for first post
the_post_thumbnail( 'medium' );
} else {
// set featured image size for other posts
the_post_thumbnail( 'thumbnail' );
}
?>
The above code (I believe) allows me to show a different size image for the first post, and different size thumbnails for the rest of the posts.