Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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