Making a Theme Beaver Builder Friendly
<?php | |
// I add a simple function to my functions.php that lets me do clean page-builder checks inside my template files. | |
// This is safe to include regardless of if bb-plugin is active or not. Won't trigger error. | |
function is_builder_layout() { | |
if (class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_enabled()) return true; | |
return false; | |
} | |
// Inside page.php I use is_builder_layout() to determine layout | |
if (is_builder_layout()) { | |
// big wide open edge-to-edge space for builder to use. Gives user the most options. | |
} else { | |
// default page layout, two column w/ sidebar maybe? | |
} | |
// CSS - You may need to release the max-width styling on your main container element when using a builder layout. | |
// Beaver builder kindly includes .fl-builder on the body element whenever a page is displaying a layout. | |
.fl-builder main { | |
max-width: none; | |
} | |
// If you're using bootstrap, you have to be a little more specific about targeting the .container element inside just the content area of your template. | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment