Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Last active February 9, 2022 14:40
Show Gist options
  • Save wpsmith/3666330 to your computer and use it in GitHub Desktop.
Save wpsmith/3666330 to your computer and use it in GitHub Desktop.
Force Specific Layout on a page
/**** Truly Force Layout without allowing the User to Override the preferred/recommended layout ****/
// Force Full Width Layout
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
// Force Content-Sidebar Layout
add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' );
// Force Sidebar-Content Layout
add_filter( 'genesis_site_layout', '__genesis_return_sidebar_content' );
// Force Content-Sidebar-Sidebar Layout
add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar_sidebar' );
// Force Sidebar-Sidebar-Content Layout
add_filter( 'genesis_site_layout', '__genesis_return_sidebar_sidebar_content' );
// Force Sidebar-Content-Sidebar Layout
add_filter( 'genesis_site_layout', '__genesis_return_sidebar_content_sidebar' );
/**** Force Layout but allow the User to Override the preferred/recommended layout ****/
// Force Full Width Layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
// Force Content-Sidebar Layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
// Force Sidebar-Content Layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
// Force Content-Sidebar-Sidebar Layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar_sidebar' );
// Force Sidebar-Sidebar-Content Layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_sidebar_content' );
// Force Sidebar-Content-Sidebar Layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content_sidebar' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment