Random header images for WordPress
I've finally migrated my family's site over to the latest version of WordPress, and installed pretty much the same batch of plug-ins and widgets as I use here. However, I wanted something else, too--a randomly-selected image for the header of the site that changes each time the page is loaded, as seen in these four sample pictures:

(The header images are just sections I've snipped out of photos we've taken, with an artsy Photoshop filter of some sort applied.)
I searched the web, and there are a few plug-ins that offer this ability, but they came either too feature-rich, or required some additional JavaScript to work properly. I wanted the most simple, basic, and functional header image rotation solution I could find...so I wrote my own, which required all of two lines of code. I'm posting it here so that (a) I remember how I did it, and (b) in case anyone else wants a simple solution, they'll be able to find it with some help from Google (our family's site is access restricted, so posting it there wouldn't do much good...and it would confuse my relatives, who are used to only seeing pictures of our kids there!)
[continue reading…]