Ultimate Branding conflict with Extra theme

Branda's dashboard styling is gone when Extra WordPress theme is enabled.

  • Predrag Dubajic
    • Support

    Hi Amy,

    It seems that this is an issue with Extra theme and how it's using admin_body_class in wp-content/themes/Extra/framework/functions.php on line 455.

    I had a look at the same function in Divi since it's working fine with that and if I replace the code in Extra with the one used in Divi then Branda panel is working fine.

    You should get in touch with theme developers about this and should be an easy fix from their end.

    Best regards,
    Predrag

  • Predrag Dubajic
    • Support

    Hi Amy,

    I'm afraid that I don't see a fix for this without changing the parent theme.
    In the mentioned file this is the function is what's causing the issue:

    function et_add_wp_version( $classes ) {
    	global $wp_version;
    
    	// add 'et-wp-pre-3_8' class if the current WordPress version is less than 3.8
    	if ( version_compare( $wp_version, '3.7.2', '<=' ) ) {
    		if ( 'body_class' === current_filter() )
    			$classes[] = 'et-wp-pre-3_8';
    		else
    			$classes = 'et-wp-pre-3_8';
    	} else {
    		if ( 'admin_body_class' === current_filter() )
    			$classes = 'et-wp-after-3_8';
    	}
    
    	return $classes;
    }
    add_filter( 'admin_body_class', 'et_add_wp_version' );

    And when I replace that with this one from Divi then it works fine:

    function et_add_wp_version( $classes ) {
        global $wp_version;
    
        $is_admin_body_class = 'admin_body_class' === current_filter();
    
        // add 'et-wp-pre-3_8' class if the current WordPress version is less than 3.8
        if ( version_compare( $wp_version, '3.7.2', '<=' ) ) {
            if ( 'body_class' === current_filter() ) {
                $classes[] = 'et-wp-pre-3_8';
            } else {
                $classes .= ' et-wp-pre-3_8';
            }
        } else if ( $is_admin_body_class ) {
            $classes .= ' et-wp-after-3_8';
        }
    
        if ( $is_admin_body_class ) {
            $classes = ltrim( $classes );
        }
    
        return $classes;
    }
    add_filter( 'body_class', 'et_add_wp_version' );
    add_filter( 'admin_body_class', 'et_add_wp_version' );

    And since in Extra theme there's no check if that function is already defined you will get fatal error if you add Divi code in your child theme, so at the moment the solution would be to replace the function in Extra parent theme with the one from Divi.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.