Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active December 25, 2015 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save srikat/6915374 to your computer and use it in GitHub Desktop.
Save srikat/6915374 to your computer and use it in GitHub Desktop.
Adding a widget area below header in Agency Pro. http://sridharkatakam.com/adding-widget-area-header-agency-pro/
<?php
//* Do NOT include the opening php tag
//* Add support for structural wraps
add_theme_support( 'genesis-structural-wraps', array(
'header',
'site-tagline',
'nav',
'subnav',
'home-featured',
'site-inner',
'footer-widgets',
'footer'
) );
//* Register Home Featured widget area
genesis_register_sidebar( array(
'id' => 'home-featured',
'name' => __( 'Home Featured', 'agency' ),
'description' => __( 'This is the home featured section.', 'agency' ),
) );
/** Add the home featured section */
add_action( 'genesis_after_header', 'sk_home_featured' );
function sk_home_featured() {
if ( is_active_sidebar( 'home-featured' ) && ( is_home() || is_front_page() ) ) {
printf( '<div %s>', genesis_attr( 'home-featured' ) );
genesis_structural_wrap( 'home-featured' );
genesis_widget_area( 'home-featured', array(
'before' => '<div class="widget-area">',
'after' => '</div>'
) );
genesis_structural_wrap( 'home-featured', 'close' );
echo '</div>';
}
}
/* Adding a widget area below header in Agency Pro
--------------------------------------------------- */
.home-featured {
margin-top: 2rem;
}
.home-featured .widget-area {
padding: 2rem;
/*background: rgba(0, 0, 0, 0.5);*/ /*dark*/
background: rgba(255, 255, 255, 0.5); /*light*/
/*color: #fff;*/ /*dark*/
color: #000; /*light*/
margin-top: 2rem;
font-family: 'Spinnaker', sans-serif;
font-size: 1.5rem;
}
.home-featured .widget-title {
color: #fff;
text-align: center;
font-size: 2rem;
}
.home-featured + .home-top .wrap {
padding: 5% 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment