Aleš Sýkora / January 17, 2024 / 0 comments

Bricks: wp_body_open and wp_footer don’t work

Post summary: Bricks builder doesn’t work with wp_body_open and wp_footer actions. You need to use custom actions instead.

If you want to add some code to your Bricks builder made WordPress website – for example with Advanced Scripts od WPcodeBox, than you may encounter problem when using actions for body and footer.

This actions doesn’t work in Bricks builder:

add_action('wp_body_open', function() {
	echo 'something';
});
add_action('wp_footer', function() {
	echo '<something>';
});

You must use custom Bricks actions instead

For wp_body_open use: bricks_before_site_wrapper

For wp_footer use: bricks_after_site_wrapper

Example in WPcodeBox 2

Here is the example of loading Swiper in body:

Here is the example of loading HTML tag in body using Bricks:

Conclusion

It is highly recommended to embed custom scripts in the footer insted of header and also defer and async the scripts. If you use Bricks, do not forget to use the right actions.

Fuel my passion for writing with a beer🍺

Your support not only makes me drunk but also greatly motivates me to continue creating content that helps. Cheers to more discoveries and shared success. 🍻

0 comments

Share Your Thoughts