How to Show Default Image if Featured Image is not Added
The “the_post_thumbnail()” function for featured image in WordPress does not shows anything if a featured image is not attached to the post. In case you want to show a default image in your theme if a user has not attached any featured image then use following script: