Australia's Leading Digital Marketing Experts. T. 1300 235 433  |  Aggreagtion Enquires Welcome

AdSense Shortcode

This is an early WordPress snippet we included on Internoetics. We recommend you visit our AdSense Plugin for a more robust solution.

1
<?php 
2
/*
3
    AdSense Shortcode
4
    http://www.beliefmedia.com/code/wp-snippets/adsense-shortcode
5
*/
6
 
7
function beliefmedia_display_adsense() {
8
 return '<p align="center"><script type="text/javascript"><!--
9
  google_ad_client = "pub-4628247728391656";
10
  /* Internoetics_468x60 */
11
  google_ad_slot = "7478088496";
12
  google_ad_width = 468;
13
  google_ad_height = 60;
14
  //-->
15
  </script>
16
  <script type="text/javascript"
17
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
18
  </script></p>';
19
}
20
add_shortcode('adsense', 'beliefmedia_display_adsense');

Usage is with [adsense]. Create as many shortcodes as necessary to support each instance of an ad block... a messy solution. Again, check out our plugin.

Like this article?

Share on facebook
Share on Facebook
Share on twitter
Share on Twitter
Share on linkedin
Share on Linkdin
Share on pinterest
Share on Pinterest

Leave a comment