Last active
December 25, 2015 08:59
-
-
Save jamesmm77/6950329 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
/* Featured Top Widget Area on Homepage | |
------------------------------------------------------------ */ | |
genesis_register_sidebar( array( | |
'id' => 'featured-top-left', | |
'name' => __( 'Top Left Featured', 'jm-theme' ), | |
'description' => __( 'This is the top left featured section.', 'jm-theme' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'featured-top-right', | |
'name' => __( 'Top Right Featured', 'jm-theme' ), | |
'description' => __( 'This is the top right featured section.', 'jm-theme' ), | |
) ); | |
/** Add the home featured section */ | |
add_action( 'genesis_before_content_sidebar_wrap', 'top_featured_widget_area' ); | |
function top_featured_widget_area() { | |
if ( is_home() || is_front_page() ) { | |
echo '<div class="featured-top">'; | |
genesis_widget_area( 'featured-top-left', array( | |
'before'=>'<div class="featured-top-left widget-area">', | |
'after' =>'</div>' | |
) ); | |
genesis_widget_area( 'featured-top-right', array( | |
'before'=>'<div class="featured-top-right widget-area">', | |
'after' =>'</div>' | |
) ); | |
echo '</div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment