Last active
December 14, 2015 07:08
-
-
Save braddalton/5047932 to your computer and use it in GitHub Desktop.
Add Home Page Widget Area For Slider Using The Prose Child Theme
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', 'prose' ), | |
'description' => __( 'This is the slider section of the homepage.', 'prose' ), | |
) ); | |
/** | |
* @author Brad Dalton - WP Sites | |
* @link http://wpsites.net/web-design/home-page-slider-prose-theme/ | |
*/ | |
add_action( 'genesis_before_content_sidebar_wrap', 'child_before_post_box' ); | |
function child_before_post_box() { | |
if ( is_home() && is_active_sidebar( 'home-slider' ) ) { | |
echo '<div id="home-slider">'; | |
dynamic_sidebar( 'home-slider' ); | |
echo '</div><!-- end #home-slider -->'; | |
} | |
} | |
// Add this code to the end of the Prose child theme's /lib/init.php file. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment