Last active
July 27, 2018 11:01
-
-
Save JayOkey/5b3a17ef8b1c85d80c9654dce183432c to your computer and use it in GitHub Desktop.
Sets the GeneratePress Page Builder Layout to full width when Beaver Builder has been used to create the layout of the page
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 | |
/*** | |
* Automatically set GeneratePress to full width layout when Beaver Builder active on page | |
***/ | |
function jo_custom_body_class( $classes ) { | |
if ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_enabled() ) { | |
$classes[] = 'full-width-content'; | |
$classes[] = 'hide-page-header'; | |
return $classes; | |
} | |
return $classes; | |
} | |
add_filter( 'body_class', 'jo_custom_body_class', 20 ); | |
function jo_remove_page_title( $output ) { | |
if ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_enabled() ) { | |
return false; | |
} | |
return $output; | |
} | |
add_filter( 'generate_show_title', 'jo_remove_page_title' ); | |
function jo_custom_sidebar_layout( $layout ) { | |
if ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_enabled() ) { | |
return 'no-sidebar'; | |
} | |
return $layout; | |
} | |
add_filter( 'generate_sidebar_layout', 'jo_custom_sidebar_layout' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment