Skip to content

Instantly share code, notes, and snippets.

@idavinder
Created March 11, 2014 09:06
Show Gist options
  • Save idavinder/9482064 to your computer and use it in GitHub Desktop.
Save idavinder/9482064 to your computer and use it in GitHub Desktop.
Adsense Ads below Post Title in Genesis Theme
//*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 -->';
}
}
@isaumya
Copy link

isaumya commented Mar 28, 2015

Thanks for the snippet :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment