Title: Header Automatic Change
Last modified: August 18, 2016

---

# Header Automatic Change

 *  [metaltiger](https://wordpress.org/support/users/metaltiger/)
 * (@metaltiger)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/header-automatic-change/)
 * I would like to be able to rotate the kubrickheader from a bank of photographs
   with each refresh. This is outside the relm of WordPress program, it would have
   to be an add on or plug-in. Any ideas on how to go about this?
 * Sounds like a neat idea for [http://metaltiger.org](http://metaltiger.org)
 * Thanks for the suggestions.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [kjarrett](https://wordpress.org/support/users/kjarrett/)
 * (@kjarrett)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/header-automatic-change/#post-151720)
 * Here you go!
 * [http://www.redalt.com/Tools/kubrickr.php](http://www.redalt.com/Tools/kubrickr.php)
 * -kj-
 *  [Cyndy Otty](https://wordpress.org/support/users/ceo/)
 * (@ceo)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/header-automatic-change/#post-151724)
 * Uhh, I think [Matt’s Random Image Script](http://photomatt.net/scripts/randomimage)
   is more what MetalTiger had in mind.
 *  [mike3k](https://wordpress.org/support/users/mike3k/)
 * (@mike3k)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/header-automatic-change/#post-151761)
 * I just did it. See it at [http://www.mcdevzone.com/](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; }
 *  [Brent Logan](https://wordpress.org/support/users/bl/)
 * (@bl)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/header-automatic-change/#post-152135)
 * 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](http://blogan.net)
 *  Thread Starter [metaltiger](https://wordpress.org/support/users/metaltiger/)
 * (@metaltiger)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/header-automatic-change/#post-152138)
 * Thank you all so much. This gives me something to work on. Thank you again.
 *  [Brent Logan](https://wordpress.org/support/users/bl/)
 * (@bl)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/header-automatic-change/#post-152181)
 * 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](http://blogan.net/blog/?p=102).

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Header Automatic Change’ is closed to new replies.

## Tags

 * [header art](https://wordpress.org/support/topic-tag/header-art/)
 * [header image](https://wordpress.org/support/topic-tag/header-image/)
 * [rotate](https://wordpress.org/support/topic-tag/rotate/)

 * 6 replies
 * 5 participants
 * Last reply from: [Brent Logan](https://wordpress.org/support/users/bl/)
 * Last activity: [21 years, 3 months ago](https://wordpress.org/support/topic/header-automatic-change/#post-152181)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
