Skip to content

Instantly share code, notes, and snippets.

@ChrisCree
Last active December 23, 2015 03:49
Show Gist options
  • Save ChrisCree/6575827 to your computer and use it in GitHub Desktop.
Save ChrisCree/6575827 to your computer and use it in GitHub Desktop.
This is a conditional removal of the primary and secondary Genesis sidebars for compatibility with the recent changes to the Genesis Simple Sidebars plugin in themes where the primary and secondary sidebars have been replaced by theme sidebars. For Web Savvy Marketing themes, we're adding this code to the /theme-name/lib/structure/sidebar.php fi…
<?php
// Do not copy the opening php tag
// Conditionally unregister sidebar(s)
if ( ( is_admin() && wsm_is_widgets_page() ) || ( !is_admin() ) ) {
unregister_sidebar( 'sidebar' );
//unregister_sidebar( 'sidebar-alt' );
// For themes without 3 column layouts the sidebar-alt function stays in the functions.php file to remove it everywhere.
}
function wsm_is_widgets_page() {
return in_array( $GLOBALS['pagenow'], array( 'widgets.php', ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment