Created
March 11, 2014 09:06
-
-
Save idavinder/9482064 to your computer and use it in GitHub Desktop.
Adsense Ads below Post Title in Genesis Theme
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
//*FOR NEW HTML5 GENESIS THEMES | |
//* New Widget area to show ads under post title | basicwp.com/add-adsense-ads-genesis-single-posts/ | |
genesis_register_sidebar( array( | |
'id' => 'ad-after-title', | |
'name' => __( 'Ad After Title', 'custom' ), | |
'description' => __( 'This is Ad section under post title', 'custom' ), | |
) ); | |
//* Show ads below post title on posts | |
add_action( 'genesis_entry_header', 'basicwp_post_ad_feature', 12 ); | |
function basicwp_post_ad_feature() { | |
if ( is_single() && is_active_sidebar( 'ad-after-title' ) ) { | |
echo '<div class="ad-after-title">'; | |
dynamic_sidebar( 'ad-after-title' ); | |
echo '</div><!-- end .ad-after-title -->'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the snippet :)