Check if a page is using a Beaver Builder layout
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 | |
function is_beaver_builder_layout() { | |
if( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_enabled() ) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
// Use this inside your template files (page.php, single.php ...) to check | |
if( is_beaver_builder_layout() ) { | |
// Ok, this page use is a Beaver Builder layout | |
} else { | |
// Ko | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment