1

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 );

1 Answer 1

3

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' );
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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