there is no div in the pastebin code – you might need to post/paste more code such as the full code of the template you are working with.
to be able to check conditionally if there is caption text, you might need to re-write the functions to return the text instead of echoing it.
Apologies this is correct code that I have modified to use:
http://pastebin.com/9zA1psg5
This is how I display it:
<div class="f_image">
<?php if ( has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <?php the_post_thumbnail(); ?>
<?php the_post_thumbnail_caption(); ?></a>
<?php endif; ?>
</div>
and the CSS:
http://pastebin.com/0aZSTEWP
—-
All help is appreciated.
try and change this line:
echo '<div class="f_caption"><h3>'.$thumbnail_image[0]->post_excerpt.'</h3></div>';
to:
if( $thumbnail_image[0]->post_excerpt ) echo '<div class="f_caption"><h3>'.$thumbnail_image[0]->post_excerpt.'</h3></div>';
alchymyth
Thank you so much – you are genius and a star. I offer you a virtual handshake.