Last active
May 19, 2016 03:03
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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