SOLVED: Adding template to entire website is not working

Bricks Version: 1.5 RC2

Here is a quick video where I show/explain the issue:
https://drive.google.com/file/d/1tMpGpte41l2mYTUTPXSwybtciEOuPuFn/view?usp=sharing

I need to create a Template (section/element) that is common among all pages of the website

  • I have tried creating it as a Header, Single and as a Section type of Template,
  • I set it’s conditions to Entire Website

However it never seems to work, it just doesn’t show on any page and I am not sure if I am configuring something wrong or if this is a bug.

This is a part of the previous question I raised here of building a website with both vertical and a horizontal header

I can give internal access if necessary

Hello Jaime,

Thank you for your post.

A quick context about the pages and Bricks templates:

  • Bricks will try to find the suitable header, content, and footer templates for every page rendered with Bricks, based on the template conditions. This means that if you set two header templates with the condition “Entire Site”, Bricks will only use one (the newest template).
  • The section template will not be triggered by any template condition. This will change in the near future when we implement the following Bricks idea: Ideas – Bricks

Getting back to the issue you are facing, I think a possible workaround to build a layout with a vertical header template + an horizontal top bar on every page (as described here), is to create the top bar as a section template, and then use the Bricks template shortcode to render that section template using the following code (add it to your Bricks child theme functions.php):

add_action( 'bricks_after_header', function() {
    echo do_shortcode( '[bricks_template id="XXX"]' );
});

Where the XXX is the ID of your section template (the one that has the top bar).

Please let me know if this approach is suitable for you.

Thank you
Luis

2 Likes

Thank you @luistinygod !
I appreciate it. it is a fix for this issue however not an ideal one as there are some issues with it ( things are not displayed quite right such as no margin from the vertical header)
It would be awesome to see it being officially supported to add more headers or parts/sections :slight_smile:

I have created a feature request on the roadmap page, so anyone facing this issue (who would like to use vertical headers) please vote for it here

1 Like

Hi Jaime,
We’ve implemented this feature in Bricks 1.9.1/1.9.1.1, now available as a one-click update in your WordPress Dashboard.

Please let us know if you are still experiencing issues.

Best regards,
timmse