Default Thumbnail/default image when empty
-
Hi All,
I have had a browse around the web and managed to find some code to add a default image when no featured image has been set but I am a struggling a little to implement it to the below code.
In effect, I have imported a blogroll from Joomla and there are over 100 entries without any featured image or thumbnails so I would like to add a default image (blog_default.jpg) when nothing has been set as the featured.
<div class="feat_img"> <?php $thsrc = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium', false, '' ); $fullsrc = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false, '' ); echo ('<a href="'.$fullsrc[0].'"><img src="'.$thsrc[0].'"/></a>'); ?> </div>
I hope you can help – Thanks in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Default Thumbnail/default image when empty’ is closed to new replies.