Question: How do i integrate PHP into my CSS?
Why: I want to have a random header image, and the 2 plugins i grabbed won’t work.
in my style.css i want to edit this entry:
And i have this php to grab random images (named 1.jpg, 2.jpg) from a folder.
// Change this to the total number of images in the folder
$total = “2”;
// Change to the type of files to use eg. .jpg or .gif
$file_type = “.jpg”;
//Starting the randomizing
$start = “1”;
$random = mt_rand($start, $total);
$image_name = $random . $file_type;
The images and the php will be in the same folder.
So how do i integrate my PHP file into my CSS? Just naming it in the url tag won’t work.
- The topic ‘How to call PHP in your CSS: specifically changing header imgs’ is closed to new replies.