Skip to content

Instantly share code, notes, and snippets.

@christophercochran
Created June 28, 2012 05:17
Show Gist options
  • Save christophercochran/3009256 to your computer and use it in GitHub Desktop.
Save christophercochran/3009256 to your computer and use it in GitHub Desktop.
Conditionally force content sidebar layout for single posts. (For the Genesis Framework)
/**
* Conditionally force content-sidebar layout for single posts.
*/
function cc_layout_logic() {
/**
* Genesis layout helper functions.
* __genesis_return_content_sidebar
* __genesis_return_sidebar_content
* __genesis_return_content_sidebar_sidebar
* __genesis_return_sidebar_sidebar_content
* __genesis_return_sidebar_content_sidebar
* __genesis_return_full_width_content
*/
if ( is_single() )
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar');
}
add_action( 'get_header', 'cc_layout_logic');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment