AdShare

This plugin is deprecated. It is no longer maintained or updated.

AdShare allows you to rotate AdSense ads based on the author of the current post.

Version: 0.2

Compatibility: WordPress 2.7+

Download: AdShare

Installation

Download and extract the plugin from the above link. Upload the adshare folder to your plugins directory. You can then activate the plugin for your Wordpress dashboard. The AdShare link will appear under the settings menu. In the configuration menu add your default AdSense publisher ID (the ID you want to use when another is not available or on the home page). You can also add any additional AdSense IDs at this point.

Usage

For Ads coded into your theme

If your ads are coded directly into your theme (ie you put your AdSense code directly into the source code) use the following method.

Your AdSense code should look something like this:


<script type="text/javascript"><!--
google_ad_client = "pub-#########";
/* 200x200, created 5/8/09 */
google_ad_slot = "7063182567";
google_ad_width = 200;
google_ad_height = 200;
// -->
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">

Where pub-######## is your publisher id. Replace pub-######## with <?php global $pubid; echo $pubid; ?>

Ex.

<script type="text/javascript"><!--
google_ad_client = "<?php global $pubid; echo $pubid; ?>;";
/* 200x200, created 5/8/09 */
google_ad_slot = "7063182567";
google_ad_width = 200;
google_ad_height = 200;
// -->
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>

Make sure not to remove the surrounding quotes.

For Ads in a widget or post
If you put your adsense code in a widget, post, the instructions are exactly the same as above, except you use [pubid]

Ex.

<script type="text/javascript"><!--
google_ad_client = "[pubid]";
/* 200x200, created 5/8/09 */
google_ad_slot = "7063182567";
google_ad_width = 200;
google_ad_height = 200;
// --></script>
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">

Changelog

-0.2Beta

  • Beta Release

-0.1Beta

  • Alpha Version
  • Twitter
  • Digg
  • StumbleUpon
  • Delicious
  • Reddit
  • Technorati Favorites
  • Slashdot
  • Share/Bookmark

5 Comments

  1. bobby says:

    is it compatible with wordpress 2.8?

  2. Have you actually had this work? I have replaced my pub id with a friends using my slot id and I get blanks instead of ads. I think the slot and pub are connected in some way.

  3. How has this been working out? I was under the impression that the slot ID was linked the the pub ID so this type of rotation wouldn’t work any more, I had almost stopped pursuing it.

Leave a Reply