I run a website with multiple custom post types. The default setting is set to separate containers. I would like to have the blog section and single post type to have only one container.
I lifted the code below from another post but it’s only partially working. I seem to be missing something.
add_filter( ‘body_class’, ‘ivan_body_class’, 100, 2 );
function ivan_body_class( $wp_classes, $extra_classes )
{
$wp_classes[] = ‘one-container’;
if ( is_front_page() || is_single() ) {
$wp_classes = array_diff( $wp_classes, array( ‘one-container’ ) );
} else {
$wp_classes = array_diff( $wp_classes, array( ‘separate-containers’ ) );
}
// Add the extra classes back untouched
return array_merge( $wp_classes, (array) $extra_classes );
}