images
Display Random images
Submitted by ravisagar on Thu, 11/20/2008 - 07:56Yesterday I came across this excellent tutorial to display Random Images. I also tried it and implemented it on this site.
1. I use bluemarine theme for this site. I created a folder "images" and uploaded three images in there.
themes/bluemarine/images
header_1.jpg
header_2.jpg
header_3.jpg
2. Modified "page.tpl.php" and added the following code
<img src="/themes/bluemarine/images/header_<?php echo(rand(1,3)); ?>.jpg" alt="Ravi Sagar" / id="random_header">
3. Modified "style.css" and add section to handle "random_header"
#random_header {
float: left;
width: 900px;
height: 170px;
}
float: left;
width: 900px;
height: 170px;
}
- ravisagar's blog
- 1 comment
- Read more
- 1507 reads




