Use WP125 as an Ad Rotator

I’ve received a few emails now asking for ad rotation features in WP125. Now, that’s not something I want to build into the plugin’s core files. Only a few people want it, and I don’t want to make the code needlessly bloated over something that doesn’t fit the ordinary uses and intention of the plugin.

After telling most of those people something along the lines “sorry, unsupported,” I came up with a quick solution (that one emailer was lucky enough to get). This solution doesn’t modify the plugin code, and seems to work pretty well. I figured I’d share it here, in case there’s anyone else who wants it.

Basically, if you want to have a rotation instead of a “normal” block of 125×125 ads, you just need to make use of the handy <?php wp125_single_ad(num); ?> template tag I created for “unforseen circumstances” when I wrote WP125. Just put this code where you want your rotation to appear:

<?php wp125_single_ad(rand(1,6)); ?>

Just replace the “6” with the number of ad slots you have.

Now, fill your ad slots with banners and you’re done.