Last active
January 16, 2017 15:41
-
-
Save robertstaddon/38ba7189b2268c3048065736c00e4c29 to your computer and use it in GitHub Desktop.
Remove Divi sidebar styling on BuddyPress / BBPress pages by removing body classes
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 | |
add_filter('body_class', 'modify_body_classes', 20); | |
function modify_body_classes( $classes ) { | |
if( is_buddypress() || is_bbpress() ) { | |
$remove_classes = array('et_right_sidebar', 'et_left_sidebar', 'et_includes_sidebar'); | |
foreach( $classes as $key => $value ) { | |
if ( in_array( $value, $remove_classes ) ) unset( $classes[$key] ); | |
} | |
$classes[] = 'et_full_width_page'; | |
} | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment