The image_size
parameter lets you include a thumbnail in your post listing, but it only works if the post has a featured image attached to it.
The code snippet below lets you specify a default image ID to use in case a post doesn’t have a thumbnail. You can find the image ID by going to Media, selecting the image, and looking at the URL (ex: ?item=80 ).
[display-posts image_size="thumbnail" default_image="80"]
This code snippet goes in a core functionality plugin or Code Snippets.
Filters used:
display_posts_shortcode_output