Ad Rotator is a simple WordPress widget to display random HTML code from a given group of HTML-chunks separated with <!--more--> on sidebar. Basically it shows different HTML every time you requesting page. There are infinite number of instances of this widget may exist.

Installation

Go to the Appearence/Widgets page in Site Admin and drag as many Ad Rotator widgets to your sidebars as you wish. Configure instances separating HTML blocks with <!--more-->. Save changes.

Now on Ad Rotator blocks should appear on your sidebars.

Migrating from AdRotator plugin

AdRotator plugin is a simple file-based ad rotation solution. It was developed by Angsuman Chakraborty long time ago, but occasionally we have the same plugin names from WordPress’ point of view. If you are using this plugin, you may click upgrade link from your Plugins page and it being replaced with Ad Rotator widget.

So now you have two ways to solve the problem 'getad()' function is undefined:

You can download AdRotator and ignore upgrade notices, or

You can upgrade your theme to use Ad Rotator Widget.

Here is how to upgrade your theme. Find all occurrences of getad function,
and replace them with something like this:

Make sure you’ve replaced ad-area with the name suitable for you. Also
you can specify additional options, like before_title and after_title.

Then open the Appearence/Widgets page in Site Admin and configure Ad Rotator widget instances for your advertisements area. Just take into account, that in files for AdRotator ads are separated with new line character (ie each line means separate ad), but in Ad Rotator widget you should separate you blocks with <!--more--> (so each of them may contain more then one line.)

95 Responses to this entry

Please excuse my naivete, but I have installed the widget but I have a question.

I understand that I am supposed to take the “html code” and add it to the widget. My question is where do I get the code from? Do I need to sign up somewhere? When I unzipped the file, there was only a widget.php file. Is there something I missed? I’m using WordPress 2.5.1.

What a fantastic widget! I have been looking high and low for a widget that you could put custom HTML instead of just text, and this is it! You could advertise this as a custom HTML widget as well, cause I know I can’t be the only one looking for it.

I’m getting the same “Fatal error: Cannot use string offset as an array” problem as Mimi above. It happens when I try to go to my “Widgets” page in wp-admin. It used to work fine, now it doesn’t. I tried erasing the data in Mysql but it didn’t work. Suggestions please? It was such a useful plugin.

Right now I have 3 ad rotator widgets that are all working fairly well however, I want more. I have tried to request more using the “how many do you want” option but no matter how many I choose none appear. What am I doing wrong?

Might want to update it and maybe, just maybe submit it to the WordPress Plugin database so we can find the updated version on there too… it would be a waste if you didn’t and left the widget here to die.

Prior to upgrading to WordPress 2.8, Ad Rotator had the option to select multiple instances of the plugin. Now the selection for multiple instances is still there but no additional Ad Rotators appear after choosing a number of extra copies. Is this something that can be tweaked in the plugin to make it compatible or is this a bug to be pursued at WordPress.org?

Is there any way to stop the plugin from trying to escape quotes when you add some html? I am trying to add a banner image withing a link and it doesn’t show up because the plugin automatically escapes the quotes.

How do I have the rotating ads show up in my Theme? I did not understand the directions. I created a TXT file with the HTML for images and links, and uploaded it to the wp-content folder. Is this method still used with this new version?

I just updated and I’ve had a few issues. First, the update essentially deleted all my existing rotators. Luckily I was planning on changing the ads anyway. Now, as I’m starting over, the rotators are showing multiple ads stacked on each other with (!–more–) between them.

Hi Dmytro, I must be pretty thick!!…I have finally been able to get the first image to appear, but the images won’t rotate. Can you please take a look at the code below and tell me what I am doing wrong? Thanks, Steve

Looks like you are using outdated WordPress version. You should update it to at least 2.8.0 to use this plugin. And I think you should do the upgrade, because there are many known security holes in old version, and your blog could be hacked by someone.

I’m using this plugin in all of my websites.. The beauty is this will decrease down the ad blindness and users tends to click more on ads..More over other benifit is I can keep track of CTR and check which ad is performing well and remove the non performer..
My Kudos to this pligin

I installed this plugin this morning because I was being prompted to upgrade from the old Ad Rotator plugin at http://blog.taragana.com/index.php/archive/wordpress-plugin-adrotator-rotate-your-ads-including-adsense-dynamically/
This plugin appears to do exactly what that one had done. The only difference between the two is that this one works in a widget whereas the old one worked with a template tag. I had gotten around the template tag issue when widgets were introduced by writing my own widget for the old plugin so I essentially had the same functionality on my website before I installed this one. And I have not had to update it for different WordPress versions (while this one seems to need updating occasionally). I’ll use this one for a while to see if there’s any real benefit to it but will probably switch back after a while.

And FYI – if you’re running the old version and want to keep it without getting prompted to upgrade to this one simply change the filename of the old one.

Having two plugins with the same name is bad enough, but making one rewriting over the other is very ugly thing in life. Having to redownload and reinstall the old one just because you thing widgets are nice is not appreciated.

I realize this is an old plugin and the last comment here was in November of 2009. But I’m hoping the author is still monitoring comments. I just installed the plugin and have it working well. I’ve put three Ad Rotator widgets in my sidebar, since I want three ads stacked vertically. I populated each widget with the same content (10 images wrapped with the appropriate html and separated by ). My goal is to have each ad appear in any one of the three positions randomly so that over time, each one gets equal exposure in each of the positions. The only problem is that on some page reloads, the same ad appears in two widgets. I know this is just because of the nature of randomization and the relatively small number of ads I have. But is there a way to link each instance of the widget and have each one omit an ad (and pick another) if another widget has already randomly selected it? Even running 10 ads in three spots, I can get the same ad in two spots fairly frequently. That’s what I’m trying to eliminate. Any ideas? Thanks!

Hello, I came across this page looking for exactly what this plugin seems to do – and that is rotate adverts in a sidebar widget.
But, can you please let me know if this plugin is up to date for 2011?
Or does anyone know of a similar plugin, please?

I’m noticing that this plugin/widget does not show up on a lot of browsers – Firefox, Chrome, etc. It’s not that the code doesn’t work, it seems to be getting blocked by some anti-adware. Is there anyway to “sanitize” the code so that doesn’t happen?

Post a comment

Name (required)

Email (will not be published) (required)

Website

You can use simple HTML-formatting tags (like <a>, <strong>, <em>, <ul>, <blockquote>, and other). To format your code sample use [cclang="php"]$a = "hello";[/cc] (allowed languages are ruby, php, yaml, html, csharp, javascript). Also you can use [cc][/cc] block and its syntax would not be highlighted.