Skip to content

Instantly share code, notes, and snippets.

@thierrypigot
Created December 1, 2021 09:32
Show Gist options
  • Save thierrypigot/c0a7225f3893816a8291477736808e23 to your computer and use it in GitHub Desktop.
Save thierrypigot/c0a7225f3893816a8291477736808e23 to your computer and use it in GitHub Desktop.
Check if a page is using a Beaver Builder layout
<?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