Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 );
share|improve this question

1 Answer 1

up vote 3 down vote accepted

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' );
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.