Last active
December 17, 2015 23:29
-
-
Save braddalton/5690103 to your computer and use it in GitHub Desktop.
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
genesis_register_sidebar( array( | |
'id' => 'home-slider', | |
'name' => __( 'Home Slider', 'child theme' ), | |
'description' => __( 'This is the slider widget area for your homepage.', 'child theme' ), | |
) ); | |
/** | |
* @author Brad Dalton - WP Sites | |
* @learn more http://wp.me/p1lTu0-9p4 | |
*/ | |
add_action( 'genesis_before_content_sidebar_wrap', 'widget_before_content_home_page'); | |
function widget_before_content_home_page() { | |
if ( is_home() && is_active_sidebar( 'home-slider' ) ) { | |
echo '<div id="home-slider">'; | |
dynamic_sidebar( 'home-slider' ); | |
echo '</div><!-- end #home-slider -->'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment