Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active December 25, 2015 01:59
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/6899290 to your computer and use it in GitHub Desktop.
Save srikat/6899290 to your computer and use it in GitHub Desktop.
To add a widgeted area below header or subnav (if present) in Genesis child theme, Blissful. Don't forget to go to Appearance -> Widgets and place your desired content via a widget in the "Leaderboard Ad" sidebar.
<?php
//* Do NOT include the opening php tag
genesis_register_sidebar( array(
'id' => 'leaderboard-ad',
'name' => __( 'Leaderboard Ad', 'blissful' ),
'description' => __( 'This is below header section.', 'blissful' ),
) );
add_action( 'genesis_after_header', 'sk_add_widget_area_below_header', 9 );
function sk_add_widget_area_below_header() {
if ( is_active_sidebar( 'leaderboard-ad' ) ) {
printf( '<div %s>', genesis_attr( 'leaderboard-ad' ) );
dynamic_sidebar( 'leaderboard-ad' );
echo '</div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment