I have a small picture ad in my sidebar, I want to show off more than one ad with a different link on each one so can't just do an animated picture. What can I do? At the moment all I'm using to do it is <div id="sidebar-ads"> <a href="AD LINK"><img src="<?php echo get_option('home'); ?>/wp-content/themes/mytheme/images/banners/Ad.png" alt="AD ALT TEXT" width="300px" height="250px" /></a> </div> Code (markup):
If you want i can help you ... to make such a script. How many ads do you want to rotate? you want random rotate no ?
Thanks, but as we are a non-profit organization, we do not have the funds available to pay for such services. The Size of the ad is width="300px" height="250px" We want to rotate 4 ads at this time but want to be able to customize this Don't really mind about order number We don't have all 4 ads finished yet though Maybe someone could help write up a template (or what ever works - I'm no programmer) in exchange for a backlink on our site
If you just want to rotate 4 (or however many) ad blocks you could just use a bit of JavaScript like this. It will randomly pick one of 4 ads, with an equal probability of picking each one. <script type="text/javascript"> var random = Math.random(); if (random < 0.25) { // put ad1 here } else if (random <0.5) { // put ad2 here } else if (random <0.75) { // put ad3 here } else { // put ad4 here } </script>
Thanks for that! In the ad section, do I just insert the images full link? Can I also put in a different hyperlink for each ad? Thanks again!
You'll need to use document.write to output your links. e.g. <script type="text/javascript"> var random = Math.random(); if (random < 0.25) { <!-- document.write('<a href="http://youlink...">yourlink</a>'); //--> }
Here is easy banner rotator http://www.htmlbasix.com/banner.shtml Just put the site URLs and banner locations and it will generate code for you.
Try max banner ads http://www.maxblogpress.com/plugins/mba/ I haven't tried it yet, but seems to be the best I could find...I will be implementing it on one of my sites in the next few weeks.