I'm trying to remove a widget area called 'Primary' from a certain page on a site. This is the function where I manage the sidebars:
//ADD CATEGORIES IN SIDEBAR OF SINGLE POST TYPE
add_action( 'genesis_sidebar', 'add_mysite_sidebar' );
function add_mysite_sidebar() {
if( get_post_type() == 'post' ){
dynamic_sidebar( 'News Categories' );
} else if( get_post_type() == 'events' ){
dynamic_sidebar( 'Event Categories' );
} else if( get_post_type() == 'documentlibrary' ){
dynamic_sidebar( 'Document Categories' );
} else if( get_post_type() == 'bp_members' ){
include(members_sidebar.php);
unregister_sidebar( 'sidebar' );
dynamic_sidebar( 'Members Widget' );
} else if( get_post_type() == 'bp_group' ){
include(groups_sidebar.php);
unregister_sidebar( 'sidebar' );
dynamic_sidebar( 'Groups Widget' );
}
}
I need to remove the 'Primary' widget area on the groups and members pages, but I don't see how to do it, and on the front end the widgets in that widget area are not in any overall container otherwise I could just hide it.
is_page()
conditional?