Skip to content

Instantly share code, notes, and snippets.

@ahmadawais
Last active October 29, 2015 08:03
Show Gist options
  • Save ahmadawais/83bea634bf8699bc9489 to your computer and use it in GitHub Desktop.
Save ahmadawais/83bea634bf8699bc9489 to your computer and use it in GitHub Desktop.
Adsense Shortcode
<?php
/**
* Adsense ad shortcode.
*
* Wrtie [adsense] in your post editor to render this shortcode.
*
* @package aa_basic_shortcodes
* @since 1.0.0
*/
function aa_adsense_shortcode() {
return '<script type="text/javascript"><!--
google_ad_client = "pub-********";
google_ad_slot = "********";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
';
}
add_shortcode('adsense', 'aa_adsense_shortcode');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment