Last active
December 19, 2015 09:29
-
-
Save braddalton/5933565 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' => 'custom-widget', | |
'name' => __( 'Custom Home Widget', 'wpsites' ), | |
'description' => __( 'Displays Content After Header Home Page Only', 'wpsites' ), | |
) ); | |
/** | |
* @author Brad Dalton - WP Sites | |
* @example http://wp.me/p1lTu0-9Jr | |
*/ | |
add_action( 'genesis_after_header', 'wpsites_custom_widget', 9 ); | |
function wpsites_custom_widget() { | |
if ( is_home() ) { | |
echo '<div class="custom-widget">'; | |
dynamic_sidebar( 'custom-widget' ); | |
echo '</div><!-- end .custom-widget -->'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment