3-Column Category Posts and Featured Image
-
I’m struggling with pulling the first Featured Image from a series of similarly Categorized Posts. I’ve uploaded three images tsing the Media Uploader. The main page (home.php)has three horizontally aligned DIVs… each pulling a separate category with the first from the posts as a “header” image. The posts are coming-in just fine… but, I always end up with a duplication of the first Featured Image in the second Category.
Here’s the code…
<?php $minicat1 = get_option('stl_mini_category1'); $my_query = new WP_Query('category_name= '. $minicat1 .'&showposts=2'); ?> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <!-- do stuff --> <?php endwhile; ?>
I repeat this three times with: minicat2, stl_mini_category2 and $minicat2… etc.
I think I’m using
has_post_thumbnail()
improperly…Any ideas?
- The topic ‘3-Column Category Posts and Featured Image’ is closed to new replies.