Twenty Eleven unregister all default sidebars?

I need to unregister all the default sidebars in the Twenty Eleven theme so I can add custom left and right sidebars via the functions.php file in a child theme.

This function below is for Twenty Ten; but I don’t know where to find the correct strings for the widget areas for Twenty Eleven, which are called Main, Showcase and Footer Areas one, Two and Three.

function remove_some_widgets(){

    // Unregister some of the TwentyTen sidebars

    unregister_sidebar( 'first-footer-widget-area' );
    unregister_sidebar( 'second-footer-widget-area' );
    unregister_sidebar( 'third-footer-widget-area' );
    unregister_sidebar( 'fourth-footer-widget-area' );
}
add_action( 'widgets_init', 'remove_some_widgets', 11 );

Related posts

Leave a Reply

1 comment

  1. Found the answer elsewhere:

    //Remove all Twenty Eleven Sidebars
    
    add_action( 'after_setup_theme','remove_twentyeleven_all_widgets', 100 );
    function remove_twentyeleven_all_widgets() {
    
    remove_filter( 'widgets_init', 'twentyeleven_widgets_init' );
    }