[Resolved] "Unregister" Widget Areas

Home Forums Support "Unregister" Widget Areas

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #334964
    Jason

    Hi Tom, I’m using GeneratePress with Beaver Builder and Beaver Themer. Works great. However I don’t need any of the sidebar/header/footer widgets that are registered in the theme and that appear on Apperance > Widgets. Normally I would just ignore them, but to reduce confusion for the client I’d prefer to eliminate them completely. Is this possible? I have a child theme setup and can edit functions.php as needed. Thanks!

    GeneratePress 1.3.48
    GP Premium 1.3
    #334993
    Tom
    Lead Developer
    Lead Developer

    Hi Jason,

    Try this:

    add_action( 'widgets_init', 'tu_remove_some_widgets', 11 );
    function tu_remove_some_widgets(){
    	unregister_sidebar( 'sidebar-1' );
    	unregister_sidebar( 'sidebar-2' );
    	unregister_sidebar( 'header' );
    	unregister_sidebar( 'footer-1' );
    	unregister_sidebar( 'footer-2' );
    	unregister_sidebar( 'footer-3' );
    	unregister_sidebar( 'footer-4' );
    	unregister_sidebar( 'footer-5' );
    	unregister_sidebar( 'footer-bar' );
    	unregister_sidebar( 'top-bar' );
    }
    #334999
    Jason

    Works beautifully. Thank you Tom!

    #335005
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.