Created
December 1, 2021 09:32
-
-
Save thierrypigot/c0a7225f3893816a8291477736808e23 to your computer and use it in GitHub Desktop.
Check if a page is using a Beaver Builder layout
This file contains hidden or 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