I am creating a new page template having a sidebar during my child theme according to twentyeleven. It does not display correctly because of this in twentyeleven's function.php:

function twentyeleven_body_classes( $classes ) {

if ( ! is_multi_author() ) {
    $classes[] = 'single-author';
}

if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
    $classes[] = 'singular';

return $classes;
}
add_filter( 'body_class', 'twentyeleven_body_classes' );

It adds the "singular" class towards the body tag on any template apart from the default sidebar-page.php, which leads to sidebar overlap.

I can not fix this using functions.php since the child theme functions.php is loaded Prior to the parent theme one (and so i can't just feel the $classes array and take away the "singular" element). I'd rather not edit the parent's functions.php as this is overwritten throughout updates, which defeats the whole reason for utilizing a child theme to begin with.

Any ideas?

EDIT: it appears I'm able to have it to operate following the parent's function.php while using after_setup_theme action hook.

Now I am getting errors though.

My code is:

add_action( 'after_setup_theme', 'childtheme_override' );

function childtheme_override() {
    add_filter('body_class', 'twentyeleven_child_body_classes');
}

function twentyeleven_child_body_classes ($classes) {
    if ( is_page_template('container-sidebar-page.php') ) {
        foreach ($classes as $key => $value) {
        if ($value == 'singular') {
                 unset($classes[$key]);
                 $classes = array_values($classes);
            }
    }
    return $classes;
}

Figured it: fixed by doing remove_filter and merely copying the parent's body_classes and adding web site towards the list that should not possess the "singular" class.

Errors are the following:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in C:\wamp\www\wp-content\themes\twentyeleven\inc\theme-options.php on line 40


Warning: join() [function.join]: Invalid arguments passed in C:\wamp\www\wp-includes\post-template.php on line 390