Featured Image Fallback in Bricks

This Pro tutorial shows bricks/element/settings filter of Bricks builder can be used to specify the ID of an image in the WordPress Media Library that should be shown for posts that do not have a featured image set in a query loop.

Note that it is also possible alternatively to simply add another Image element (besides the one for featured image) and use conditions to output one of them depending on whether each post has a featured image or not.

Add the following in child theme‘s functions.php or a code snippets plugin:

where jlsulp is the Bricks ID of your Image element that has the

{featured_image}

dynamic data tag and

194 is the attachment ID of your desired fallback image that’s in the Media Library.