Hello!
I would like to have a default image attached to posts automatically, if no specific image is selected instead.
I seem to recall finding a plug-in that fit this functionality, which also could associate images with certain categories. Unfortunately, I can't seem to find it now.
Can someone suggest code or a relevant plug-in to achieve this?
Thank you!
K
<?php if( has_post_thumbnail() ) : the_post_thumbnail();
else :?> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/default.jpg" width="xx" height="yy" alt="" />
<?php endif;?>
Hey Esmi,
Thanks for your reply. When I add that code to my index page, I get an error message stating that the function is undefined. Any thoughts?
Fatal error: Call to undefined function: has_post_thumbnail() in /home/content/k/o/n/kontainer/html/SALMELAND/blog/wp-content/themes/MyTheme/index.php on line 12