Skip to content

Instantly share code, notes, and snippets.

Last active Apr 23, 2019
What would you like to do?
Force a layout for Pages that have subpages in Genesis.
// Apply layout to static Pages that have children (subpages)
add_action( 'get_header', 'sk_force_layout' );
function sk_force_layout() {
global $post;
// if we are on a static Page and if it does not have a parent
if ( is_singular( 'page' ) && !$post->post_parent ) {
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment