Last active
December 15, 2015 11:59
-
-
Save braddalton/5257550 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
// Register Custom Widget | |
genesis_register_sidebar( array( | |
'id' => 'custom-widget', | |
'name' => __( 'My Custom Widget', 'child' ), | |
'description' => __( 'This Is My Custom Widget Area.', 'child' ), | |
) ); | |
// Hook Custom Widget Before Content On The Home Page Only | |
add_action( 'genesis_before_content_sidebar_wrap', 'after_menu_widget', 9 ); | |
function after_menu_widget() { | |
if ( is_home() && is_active_sidebar( 'custom-widget' ) ) { | |
echo '<div class="custom-widget"><div class="wrap">'; | |
dynamic_sidebar( 'custom-widget' ); | |
echo '</div></div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment