Skip to content

Instantly share code, notes, and snippets.

@brentjett
Created October 26, 2015 18:51
Show Gist options
  • Save brentjett/b6354a7b682a16735e92 to your computer and use it in GitHub Desktop.
Save brentjett/b6354a7b682a16735e92 to your computer and use it in GitHub Desktop.
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