Last active
December 25, 2015 01:59
-
-
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.
This file contains hidden or 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
<?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