$i = rand(0, count($bg)-1); // generate random number size of the array $selectedBg = "$bg[$i]"; // set variable equal to which random filename was chosen ?>
1. CSS IN THE
Normally you'd want to keep CSS out of the HTML, but we'll just use it here to echo out the random file name we selected above.
$i = rand(0, count($bg)-1); // generate random number size of the array $selectedBg = "$bg[$i]"; // set variable equal to which random filename was chosen ?>
$i = rand(0, count($bg)-1); // generate random number size of the array $selectedBg = "$bg[$i]"; // set variable equal to which random filename was chosen ?>
You need to change the file name to your files names, and you can add more images, just change where it say $n = rand(1,6); where "6" is the number of images you have.
You also need to add more links to your images the "X" is what you need to change to the sequence of files you have.
Hello, I'm new at this. Is it possible to add a duration for this script? Let's say 24hrs before the image changes to another image. Or better yet, can I assign a specific image to a specific day?
Someone can help me to apply this snippet of php (it is from this post)
here is the instructions:
1. ABOVE THE DOCTYPE
Set up and array of filenames, which correspond to the file names of the images you are trying to randomize.
1. CSS IN THE
Normally you'd want to keep CSS out of the HTML, but we'll just use it here to echo out the random file name we selected above.
What I most do to apply this on #main-content for example?.
Any help please!
Thanks,
Rai.
Thanks.
T_T
what about the first code above the doctype, you make any changes?
there is something I´m missing....
@noahgelman Thanks =)
After
Add this code:
Then create a file call it css.php on your theme folder and add this code on it:
You need to change the file name to your files names,
and you can add more images, just change where it say $n = rand(1,6); where "6" is the number of images you have.
You also need to add more links to your images the "X" is what you need to change to the sequence of files you have.
I hope this can help someone as help me, I find it on this blog (spanish)
For sure you can do that. I ear to my teacher say something about that in a project.
Rai.