There are many, many ways to do this, and it’s also possible to add allot of functionality to this. But it’s simple, and it work’s for me. So I just wanted to share it to those who can use it; A way to get random pictures on your site:
Put this code in a new snippet
<?php
echo "<img width=\"XXpx\" height=\"XXpx\" src=\"YOUR PATH". mt_rand(1,20).".jpg\" />";
?>
Where
is the number of your first picture in a stock, and the last. You get random pictures between those numbers.
You have to name your pictures with numbers.
See it in action
here. Here I have 4 folders with pictures named 1 to 40, 41 to 80, 81 to 100 and so on.
Feel free to use it wherever you want.