Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 15, 2015 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/5257550 to your computer and use it in GitHub Desktop.
Save braddalton/5257550 to your computer and use it in GitHub Desktop.
// 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