Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created February 24, 2013 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/5023716 to your computer and use it in GitHub Desktop.
Save braddalton/5023716 to your computer and use it in GitHub Desktop.
This code removes all your widgets from all widget areas on your home page. You can change the conditional tag to disable widgets from loading on specific pages etc.
add_filter( 'sidebars_widgets', 'remove_homepage_widgets' );
function remove_homepage_widgets( $sidebars_widgets ) {
if ( is_home() )
$sidebars_widgets = array( false );
return $sidebars_widgets;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment