I know that it should be quite easy to do but I can't seem to figure it out.
Firstly, I have a category, with some sub-categories. I would like to have a page that displays all the post made in that year, from within those categories using only their featured images.
However, I haven't added featured images for all the posts and would like it to default to set images for each category if it doesn't have a featured image.
In addition, I would also like to have the post name and the publication date as the link title.
Sorry for being so demanding.
I'm almost there. I can display a featured image with the link and attributes I want but I can't seem to get the fallback image working. Here is the code I have. I know it must be a simple elementary mistake. I will need to add more ElseIf statments.
<?php query_posts('cat=81&year=2011'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ( has_post_thumbnail()) ; {
<a href="<?php the_permalink(); ?>"><?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );?><img src="<?php echo $url; ?>" title="<?php the_title_attribute(); ?> <?php the_time('jS F Y') ?>" height="90" width="180" /></a>;
}
else if(in_category(91))
{
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?> <?php the_time('jS F Y') ?>" ><img src="/media/admin/hl1-thumbnail.jpg"></a>;
<?php endif; ?>
<?php endwhile; ?>
Any help would be greatly appreciated.
TIA