I've searched for similar questions to mine here, but haven't found a thread that helps me.. although I did find help here to get to the point where I am now ;)
I've created a jquery slideshow that pulls images from the featured images in a certain post category. I found the code below here at SO and got it to work to my needs so far, but I'd need to add a conditional statement to it:
if(has_post_thumbnail()) {
$showImg = wp_get_attachment_image_src( get_post_thumbnail_id ( $post->ID ), 'xiao-show-img' );
} ?>
<a href="<?php the_permalink() ?>" title="<?php the_title() ?>" rel="<?php the_excerpt() ?>">
<img src="<?php echo $showImg[0]; ?>" title="<?php the_title() ?>" rel="<?php the_excerpt() ?>" />
</a>
that works ok, but.. i'd like to use something like below to be able to load a default image into the slideshow, if there is no featured image attached to the post:
<?php
if(has_post_thumbnail()) { ?>
<a href="<?php the_permalink() ?>" title="<?php the_title() ?>" rel="<?php the_excerpt() ?>">
<img src="<?php the_post_thumbnail() ?>" title="<?php the_title() ?>" rel="<?php the_excerpt() ?>" />
</a>
<?php
} else {
?>
<a href="<?php the_permalink() ?>" title="<?php the_title() ?>" rel="<?php the_excerpt() ?>">
<img src="<?php get_bloginfo("template_url"); ?>/images/xiao-default-image.png" />;
</a>
<?php }
?>
I realise that the below example doesn't work.