Last active
March 25, 2016 10:03
-
-
Save afsalrahim/6507005287cf4bd8da9d to your computer and use it in GitHub Desktop.
A Sample Adsense Ads as shortcode for wordpress
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 | |
add_shortcode('showads468x60', 'ad_display'); | |
function ad_display() { | |
return '<div> | |
<script type="text/javascript"><!-- | |
google_ad_client = "ca-pub-3433716058123456"; | |
/* DigitCodes inPost 468x60 */ | |
google_ad_slot = "9644241234"; | |
google_ad_width = 468; | |
google_ad_height = 60; | |
//--> | |
</script> | |
<script type="text/javascript" | |
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> | |
</script> | |
</div>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment