Skip to content

Instantly share code, notes, and snippets.

@idavinder
Last active December 11, 2015 04:39
Show Gist options
  • Save idavinder/4547115 to your computer and use it in GitHub Desktop.
Save idavinder/4547115 to your computer and use it in GitHub Desktop.
Adsense ads After post cotents in Genesis Theme
//* New Widget area to show ads after post content | basicwp.com/add-adsense-ads-genesis-single-posts/
genesis_register_sidebar( array(
'id' => 'ad-after-content',
'name' => __( 'Ad After Content Area', 'custom' ),
'description' => __( 'This is Ad section after the post content area', 'custom' ),
) );
//* Show ads after post content area
add_action( 'genesis_entry_footer', 'basicwp_ad_after_content', 2 );
function basicwp_ad_after_content() {
if ( is_single() && is_active_sidebar( 'ad-after-content' ) ) {
echo '<div class="ad-after-content">';
dynamic_sidebar( 'ad-after-content' );
echo '</div><!-- end .ad-after-content -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment