I want the main site's header and footer template to work across a multisite

So I am using the below approach; I thought it would just work. Does anyone know how to achive this?

<?php
do_action( 'bricks_body' );
do_action( 'bricks_before_site_wrapper' );

switch_to_blog( '1' ); 	//switch to the main site of the network (it has ID 1)			
do_action( 'bricks_before_header' );
do_action( 'render_header' );
restore_current_blog();	//switch back to the current site
?>
1 Like

any help please? this really would be handy to get working

I have achieved this by using multisite conditionals (Is main site/ is not main site), and Mischa’s multisite crossposting plugin
(WordPress Multisite: Shared Content Between Sites) which allows you sync the template across to subsites.

Here is the example of the site I ended up creating:
Main Site

Subsite:

1 Like

So if I understand that correctly your change a template on one site with this plugin and it syncs the changes on the other sites?

I used to play around with the template shortcode and switching to another blog inside a custom element but never quite got it to work… this plugin could be very helpful…

Nowadays I just use custom elements inside templates where I can dictate the logic all inside the never changing template, but this is not great.

There are many hurdles with multisites, such as that stitch_to_blog doesn’t account for taxonomies that exist on one site but not the current one etc.

Best regards
Suat

Yes, when you update a template there is an option to sync the template with other sites. It is done through the wordpress interface for the template post type and not the bricks interface. So it’s one more step to do, however, it is the best solution I have found for Bricks Builder when using multisite installs.

That said, if I did another multisite project I would properly not use Brick builder, it was a bit too flaky for my liking.

Uh oh. I’m considering porting my current multisite theme to Bricks. Were your flakiness issues specific to multisite, or jut Bricks in general?

Unfortunately this option requires an Additional $79 a year just to get a universal header/footer.