Override the parent theme footer sidebar area in child theme

1 min read Knowledge Base

If you’d like to change the column width for the footer widgets use this code in your child themes > functions.php, in the example below I’ve changed the width from 3 to 6 columns wide (note: span_6), keep in mind the theme was built on a 12 column grid.

add_action( 'after_setup_theme', 'ct_parent_sidebar_override' );
function ct_parent_sidebar_override() {
    unregister_sidebar('Footer');   
    register_sidebar(array(
        'name' => 'Footer',
        'id' => 'footer',
        'description' => 'Widgets in this area will be shown in the footer.',
        'before_widget' => '<aside id="%1$s" class="widget col span_6 %2$s">',
        'after_widget' => '</aside>',
        'before_title' => '<h5>',
        'after_title' => '</h5>',
    )); 
}

GIST: https://gist.github.com/contempoinc/8c8156996a4e08120290f103a62ea578