Skip to content

Instantly share code, notes, and snippets.

@srikat srikat/functions.php
Last active Apr 23, 2019

Embed
What would you like to do?
Force a layout for Pages that have subpages in Genesis. https://sridharkatakam.com/force-layout-pages-subpages-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
You can’t perform that action at this time.