HTML code rotator or plugin?

by 2 replies
3
Hello

I am looking for either a script or a wordpress plugin that rotates a piece of HTML code in a page. It would be similar to a banner rotator, but just doesn't apply to images.

I am ultimately trying to display more than one opt in form at random on my site.

If anyone could help me with this it would be awesome!

Thanks
#programming #code #html #plugin #rotator
  • Hi there Travis,

    You could possibly add each rotating piece of html to an array key number. And then, using php's rand function to get a particular number, you can echo out that particular bit of html.

    For example,

    <?php
    $html_array[0] = "<p>peice of html code 0</p>";
    $html_array[1] = "<p>peice of html code 1</p>";
    $html_array[2] = "<p>peice of html code 2</p>";

    $random_number =
    echo $html_array[$random_number];
    ?>

    Hopefully that will help out!
    • [1] reply

Next Topics on Trending Feed

  • 3

    Hello I am looking for either a script or a wordpress plugin that rotates a piece of HTML code in a page. It would be similar to a banner rotator, but just doesn't apply to images.