Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Removing default sidebars

I unregistered the sidebars. As mentioned above, they go by ID… not name. Also, if you want to register NEW sidebars… they come first in line. So let’s say you register a new sidebar in your child’s function.php file named “my-sidebar” and want to unregister the other three that the parent theme uses. You have 4 sidebars now to deal with. Your’s (id = sidebar-1) and the other three from the parent. You would do something like this:

register_sidebars( 1,
array(
'name' => 'my-sidebar'
)
);

function remove_sidebar() {
unregister_sidebar('sidebar-2');
unregister_sidebar('sidebar-3');
unregister_sidebar('sidebar-4');
}
add_action( 'admin_init', 'remove_sidebar');

Skip to toolbar