Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove Divi sidebar styling on BuddyPress / BBPress pages by removing body classes
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
You can’t perform that action at this time.