$20
Display thumbnails from each category
I currently have this code on the home-page of my site. This produces a thumbnail for the 20 latest images from all categories apart from '24':
What I'd like to do is display one thumbnail from each category (say the latest image if that's easier) on the home-page instead of the above scenario. I'd also like to display the title of the category. This thumbnails would then link through to the respective category page.
Any ideas on the code to produce this?
<?php $recent = new WP_Query("cat=-24,$image_cat&showposts=20"); while($recent->have_posts()) : $recent->the_post();?>
<a href="<?php the_permalink() ?>"><img style="float:left; margin:0px 18px 18px 0px;" src="/wp-content/themes/portfolio/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "image", true); ?>&h=225&w=225&zc=1&q=100" alt="<?php the_title(); ?> by Andrew Areoff" /></a>
<?php endwhile; ?>What I'd like to do is display one thumbnail from each category (say the latest image if that's easier) on the home-page instead of the above scenario. I'd also like to display the title of the category. This thumbnails would then link through to the respective category page.
Any ideas on the code to produce this?
Andy Essex | 02/03/10 at 4:43am |
Answers | Tags
(6) Possible Answers Submitted...
You must be logged in to view answers or answer this question.



