Last active
December 11, 2015 04:39
-
-
Save idavinder/4547115 to your computer and use it in GitHub Desktop.
Adsense ads After post cotents 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
//* 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