Apply layouts conditionally
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
<!-- Apply full width layout to homepage -->
add_action( 'get_header', 'sk_force_layout' );
function sk_force_layout() {
if (is_home() || is_front_page()) {
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
}
}
<!-- Apply Sidebar Content layout to a CPT’s single entries -->
add_action( 'get_header', 'sk_force_layout' );
function sk_force_layout() {
if ( is_singular('testimonial' ) ) {
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
}
}