New Landing How can we help? Atelier I give up Reply To: I give up

#211830
peter4576
Member
Post count: 168

Also just found this one… must be easy to implement in theme settings!

Adding a Branded Image as the Default Fallback

Often when creating a custom site for a client, they may have posts that has absolutely no image. So it is always smart for designers to create a branded image that is displayed for posts that has no thumbnail specified. The philosophy of this idea is similar to having a customized gravatar in WordPress. All you really have to do is open the theme file where you are going to display the post thumbnail, this can be (home.php, single.php, loop.php, index.php, archive.php, etc). Then simply paste the following code within the post loop.
1
<?php if ( has_post_thumbnail() ) {
2
the_post_thumbnail();
3
} else { ?>
4
/images/default-image.jpg” alt=”<?php the_title(); ?>” />
5
<?php } ?>
Explanation: The code checks if the post has a specified thumbnail, and if there is, then it will display the post thumbnail. If there is no post thumbnail specified, then it will display ‘default-image.jpg’ image from your theme’s images folder.
This is the very basic example. You can obviously expand on it with thumbnail sizes, class and much more.