Last active
March 2, 2022 05:22
-
-
Save deckerweb/4549753 to your computer and use it in GitHub Desktop.
Genesis: Education 2.0 Child Theme -- Add widget support for the Education 2.0 homepage. If no widgets active, display the default loop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Add support for widgetized home page */ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'ddw_education_home_loop_helper' ); | |
/** | |
* Add widget support for the Education 2.0 homepage. | |
* If no widgets active, display the default loop. | |
* | |
* @author David Decker - DECKERWEB | |
* @link http://twitter.com/deckerweb | |
*/ | |
function ddw_education_home_loop_helper() { | |
/** Homepage widget active */ | |
if ( is_active_sidebar( 'education-home-area' ) ) { | |
dynamic_sidebar( 'education-home-area' ); | |
} | |
/** If no active widget area fall back to default loop */ | |
else { | |
genesis_standard_loop(); | |
} // end if/else | |
} // end of function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add widget area for a widgetized homepage in Education 2.0. | |
* | |
* @author David Decker - DECKERWEB | |
* @link http://twitter.com/deckerweb | |
*/ | |
genesis_register_sidebar( array( | |
'id' => 'education-home-area', | |
'name' => __( 'Education Home', 'education' ), | |
'description' => __( 'Widgetized homepage area.', 'education' ), | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment