Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
//* Register Home Page Sidebar widget area
genesis_register_sidebar( array(
'id' => 'home-page-sidebar',
'name' => __( 'Home Page Sidebar', 'genesis-theme' ),
'description' => __( 'This is a widget area at sidebar only shown in home page', 'genesis-theme' ),
) );
//* Add widget area in sidebar for Home Page Only
add_action( 'genesis_after_sidebar_widget_area', 'wbxp_home_page_sidebar' );
function wbxp_home_page_sidebar() {
if ( is_home() || is_archive() )
genesis_widget_area( 'home-page-sidebar', array(
'before' => '<div class="home-page-sidebar widget-area">',
'after' => '</div>',
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment