In the comments section of The Perfect Bricks Page Template tutorial, a user asks:
Could this be modified so that instead of has_blocks it used something like has_bricks? I'd like to take the structure that you have (Gutenberg Content section followed by Bricks div) and have it render the Gutenberg content only if the page isn't built with Bricks and use the Bricks div only if the page IS built with Bricks.
It's a small distinction, but it's because I often will build a page with Bricks and put the WPcontent element in the layout somewhere. When I do, I won't want the first section (Gutenberg) to display because then there would be duplication.
Currently I use a similar setup where the two sections display based on a Metabox switch on each page. I'd prefer to not have to toggle that switch because it often gets forgotten.
This Pro tutorial provides the steps to define a custom function that returns true or false depending on whether the current post (typically, a Page) has Bricks content and using the function with a dynamic data Bricks condition to output Bricks content when a Page is built with Bricks or WordPress content when there is no Bricks content.
Step 1
Add the following in child theme's functions.php
(w/o the opening PHP tag) or a code snippets plugin:
This is a BricksLabs Pro tutorial.
For full access login below or create your BricksLabs Pro account