Context: We are adding a new subsection of the website which has its own design, layouts, etc and they’d like to use a page builder as well. However, I’m working around current limitation with an existing theme which has all the layouts of all current pages and content. I’m modifying the existing theme to work as a child theme of Bricks AND retain the existing templates.
Now the issue I have is to have Bricks template override the child theme’s templates IF there is enabled. I think I have manage to get it to work with single CPT templates for now but I wonder if the code below is the correct direction to override:
single.php
$post_id = get_the_ID();
$bricks_data = Bricks\Helpers::get_bricks_data($post_id, 'content');
if ($bricks_data) {
// If Bricks template exists, render it
Bricks\Frontend::render_content($bricks_data);
} else {
// the original template here
}
However, I have not been able to find a way to keep the existing child theme header and template. I’m unsure which function or filters I can use to check if header or footer template is being applied conditionally to the current page/CPT/etc.