You can have random rotating images in your multimedia box, feature box, widgets, or if you really want to have freedom, you can learn how to make your own custom multimedia box and place them in it.
We’re going to rotate the images with a little php code. In order to do this we need to first prepare the images to be rotated by renaming them. Get all the images to be rotated and rename them with numbers. This works with png, jpg, gif, tiff, etc. For example…
image1.png
image2.png
image3.png
OR
image-1.png
image-2.png
image-3.png
OR
1.png
2.png
3.png
You get the idea? Get all the images you want rotated in a group, rename them with numbers starting with 1, increment by 1, and proceed in order to the total number of images in the group
Upload all the images to the proper directory
Let’s say, for example, you uploaded the images to a folder named “random”. You are using the image-n.png format where n equals the number of the image. Here’s the path that we’ll use for this example…
<img src="http://www.yoursite.com/folder/random/image-n.png" />
Now here is the php code that is going to replace n with a random number from 1 to the total number of images there is, in this case, 3
<?php echo rand(1,n); ?>
The whole code comes together like this…
<img src="http://www.yoursite.com/folder/random/image-<?php echo rand(1,n); ?>.png" />
That’s about the simplest way to get random rotating images











If you would like to leave a comment and you have examples of code you want to show, you must "escape the code". This allows the entire code to show correctly by inserting certain variable around certain tags to make them show. If you don't "escape the code" your code will show up broken, mangled, and it won't be able to be seen correctly. "Escaping the code" is very simple...
Go ahead, leave a comment...