Uhh, I think Matt’s Random Image Script is more what MetalTiger had in mind.
I just did it. See it at http://www.mcdevzone.com/
I have a series of images kubrickheader0.jpg – kubrickheader7.jpg in my images directory and I added the following script to header.php:
<?php
function header_graphic() {
echo “/images/”;
$num=rand(0,7);
echo “kubrickheader”.$num.”.jpg”;
};
?>
Finally, I changed the stylesheet header element as follows:
#header { background: url(“<?php bloginfo(‘stylesheet_directory’); header_graphic(); ?>”) no-repeat bottom center; }
Mike, your solution looks easy. Famous last words… 🙂
Clearly, I’m doing something wrong. I cut and past the php function and put it at the very top of my header.php file (the one in the themes/default directory).
I then replaced the uncommented line that starts with #header in the same header.php file with the header element shown.
I placed 9 images named kubrickheader0.jpg through kubrickheader9.jpg in the themes/default/images directory.
Now, my header is just a blue box and the footer is a gray box. I didn’t think I did anything to the footer.
What did I do wrong?
http://blogan.net
Thank you all so much. This gives me something to work on. Thank you again.
Thank you, Mike! With your help, I was able to get it working. Turns out, I was putting the php function at the very top of the header.php file, when it should go after the DOCTYPE and html lines and before the head line.
I documented it in more detail in this article.