Created
October 26, 2015 18:51
-
-
Save brentjett/b6354a7b682a16735e92 to your computer and use it in GitHub Desktop.
Making a Theme Beaver Builder Friendly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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