How To Display AdSense & Yahoo Publisher Ads Using AdRotator Plugin for WordPress
AdRotator is a WordPress plugin which you can used to randomly rotate your ads (including but not limited to AdSense, Yahoo Publisher Network, Clicksor, Chitika etc.) on WordPress blogs. It allows you to display an advertisement (which is randomly selected from a group of advertisements specified in a text file) at your chosen location. The most frequent question I get is how you can use it to display AdSense ads, with an example.
AdRotator plugin can be used to easily rotate between AdSense, Yahoo Publisher Network ads and any other javascript based ad codes in combination and in a single file. There is however a small trick to it. You need to compress the ad code in a single line. Let me illustrate with an AdSense example.
Suppose your adsense ad is as follows:
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
Then you need to reformat it as below:
Note: The above code is in a single line. Place as many as such ad codes in a single file and you can rotate between them.
This idea can be used with Yahoo ads and any other javascript based ad codes. If you face problems then you have most likely messed up your ad code somewhere.
Here is another example for other types of ads. You can refer to the AdRotator user manual for further details.
BTW: I am planning to release AdRotator Pro version in about a couple of weeks. It will make it much much simpler to manage your ad-strips, no tricks like above and no need to change your ad code, will allow placing multiple ads from the same file on the same page, without duplication, allow rotating between say Google & Yahoo ads without conflict and tons of advanced options for beginners and pro alike and lots more.
Filed under CMS Software, Headline News, How To, Pro Blogging, Tech Note, Web, Web Services, WordPress |
|
RSS 2.0 |
Trackback this Article
|
Email this Article
You may also like to read |





































September 2nd, 2006 at 10:14 pm
Hello Angsuman, I am trying to use your ad rotator
but I am getting this error.
Parse error: unexpected T_STRING, expecting ‘,’ or ‘;’ in
I even tried it like this: with no luck.
Do you know what it is asking me to adjust?
Thanks, Simone
September 2nd, 2006 at 10:19 pm
Hmmmm it wouldn’t include my php include I’ll try it without the brackets.
These are the two I tried but with php brackets.
php echo getad ’test1’;
php echo getad ’test1,test2’;
April 7th, 2007 at 10:56 am
i think this could work on my image hosting site photosharingworld.com
April 21st, 2007 at 4:59 pm
>then you need to reformat it as below, >
well it is against google ad terms , what u think abt that ?
August 23rd, 2007 at 11:42 am
Can this work in RSS feeds?
August 23rd, 2007 at 2:11 pm
Yes, but you have to modify it. Or you can contact us for developing it for you.
April 5th, 2008 at 3:08 pm
Hey, thanks for this awesome plugin.
I managed to get it work on my blog.
The thing is, it doesn’t properly show adsense. Hmm..doesn’t show at all. maybe because of lining up the code in 1 line breaks it.
Does this work with the new adsense code?