2 replies
I need some help with rotating couple of ad banners where code is placed inside single posts next to content. Ideally, the banner would rate each for each visitor i.e. first visitor will see banner 1, second will see banner 2, third will see banner 1 and so on. if tehre is a plugin that could simply add the two banner codes then it will be even better.

I don't mind pasting some code into the page and having the banner codes in between. But the more simpler the better.
#banner #code #rotating
  • Profile picture of the author Brandon Tanner
    If you want "simple", then why not just rotate the banners on a random basis? It will work out to be pretty darn close to a 50/50 split over the long run.

    <?php
    $random = (rand(0,1));
    if ($random == 0)
    {echo "<a href='http://www.Banner1Website.com'><img src='path/to/banner1/image.png'></a>";}
    else
    {echo "<a href='http://www.Banner2Website.com'><img src='path/to/banner2/image.png'></a>";}
    ?>

    ^ Just need to give that page a .php extension (ie index.php).
    Signature

    {{ DiscussionBoard.errors[8228318].message }}
  • Profile picture of the author Blakos
    If your not confident with PHP, try hiding and showing the element/s using JQuery.
    {{ DiscussionBoard.errors[8232026].message }}

Trending Topics