Skip to content

Instantly share code, notes, and snippets.

@StewartChamberlain
Last active December 20, 2015 23:19
Show Gist options
  • Save StewartChamberlain/6211534 to your computer and use it in GitHub Desktop.
Save StewartChamberlain/6211534 to your computer and use it in GitHub Desktop.
<?php // Do Not include this line
// Execute custom home page. If no widgets active, then loop
add_action( 'genesis_meta', 'sc_custom_home_loop' );
function sc_custom_home_loop() {
if ( is_active_sidebar( 'home-featured-full' ) || is_active_sidebar( 'home-featured-left' ) || is_active_sidebar( 'home-featured-right' ) || is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) || is_active_sidebar( 'home-bottom' ) ) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
add_action( 'genesis_before_content', 'sc_home_do_featured' );
add_action( 'genesis_before_content', 'sc_home_do_middle' );
add_action( 'genesis_before_content', 'sc_home_do_bottom' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment