Divi Theme Fix Footer Layout Issue on 404 Page

In Divi Theme, There is problem with Footer Layout on 404 page and no search result pages. Here below given solution to fix this issue. Copy below code snippet and add it to your Divi(-child) theme’s to functions.php file.

add_filter( 'body_class', 'cp_404_fix_footer');
function cp_404_fix_footer( $classes ) {
    if(is_404() || is_search()){
        $get_footer_column = et_get_option('footer_columns');
        $get_gutter_width = et_get_option('gutter_width');
        $footer_columns = empty($get_footer_column) ? 4 : $get_footer_column;
        $gutter_width = empty($get_gutter_width) ? 3 : $get_gutter_width;
        $classes[] = 'et_pb_footer_columns_'.$footer_columns.' et_pb_gutters'.$gutter_width;
    }
    return $classes;
}