Skip to content

Instantly share code, notes, and snippets.

@srikat
Created October 6, 2013 18:51
Show Gist options
  • Save srikat/6857607 to your computer and use it in GitHub Desktop.
Save srikat/6857607 to your computer and use it in GitHub Desktop.
Code to add in Genesis child theme, eleven40 Pro to add a Home Featured widget area above posts on homepage. Based on http://www.briangardner.com/home-widget-area-eleven40/
<?php
//* Do NOT include the opening php tag
genesis_register_sidebar( array(
'id' => 'home-featured',
'name' => __( 'Home Featured', 'eleven40' ),
'description' => __( 'This is the home featured section.', 'eleven40' ),
) );
/** Add the home featured section */
add_action( 'genesis_before_loop', 'eleven40_home_featured' );
function eleven40_home_featured() {
if ( is_home() && !get_query_var( 'paged' ) >= 2 ) {
genesis_widget_area( 'home-featured', array(
'before' => '<div class="home-featured widget-area">',
'after' => '</div>'
) );
}
}
.home-featured {
padding-top: 0;
padding-bottom: 4rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment