Add CSS to Every Beaver Builder Layout
Appends your own CSS to the stylesheet Beaver Builder generates for each layout, so it is cached and loaded together with the layout instead of on every page.
Opens WPIDE on
Code
// CSS added to each Beaver Builder layout stylesheet.
$wpide_bb_layout_css = '.fl-builder-content .fl-button{border-radius:999px;}.fl-builder-content .fl-module-heading .fl-heading{text-wrap:balance;}';
add_filter( 'fl_builder_render_css', function ( $css ) use ( $wpide_bb_layout_css ) {
return $css . "\n/* Site additions */\n" . wp_strip_all_tags( $wpide_bb_layout_css );
} );
Notes
Clear the Beaver Builder cache (Settings > Beaver Builder > Tools) after changing the CSS.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.