30th Jun '23
/
8 comments

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:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 633 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
“Truncate text to these many characters” Bricks Control

“Truncate text to these many characters” Bricks Control

Bricks provides a :<number> dynamic data tag modifier that can be used to limit the amount of text by the specified number of words. Ex.:…