Skip to content

Instantly share code, notes, and snippets.

@ryantownley
Last active May 19, 2016 03:03
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 ryantownley/576defa9a8555961d173 to your computer and use it in GitHub Desktop.
Save ryantownley/576defa9a8555961d173 to your computer and use it in GitHub Desktop.
This code snippet will remove all sidebars (including header-right area), remove all layouts other than full-width, and force full-width to be selected by default in a Genesis child theme.
//* Remove sidebars and header widget area
unregister_sidebar( 'header-right' );
unregister_sidebar( 'sidebar' );
unregister_sidebar( 'sidebar-alt' );
//* Unregister layout settings
genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
//* Force full width layout selection
add_filter( 'genesis_pre_get_option_site_layout', 'genesis_do_layout' );
function genesis_do_layout( $opt ) {
$opt = 'full-width-content';
return $opt;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment