Cutline Theme for WordPress

One Giant Leap for Mankind

Cutline Theme for WordPress header image 2

Totally Random Header Images for Cutline

October 11th, 2006 · 155 Comments · How To

A great way to make the front page of your Web site more dynamic is to use random header images. Instead of seeing the same image on every visit, users will see random images, thus making each experience on your site a little less predictable (and a little more fun!).

Get the Goods!

Basically, the theory (and thus the code) behind this is quite simple, and I’ve prepared a random header image tutorial that you can peruse at your leisure if you’re into that sort of thing.

But, because I’m all about hooking you guys up with things that are simple, easy, and good, I’ve taken the liberty of preparing a brand new header.php file that you can download and install in order to get cracking with random header images.

Header image randomizer!

Installation Notes: If you’ve made changes to your original header.php file, you may want to compare these two files first to ensure a smooth transition. Other than that, just overwrite the existing header.php file with this new one, and your headers will all be “randomized!”

Update: These files are now only provided for legacy support on versions 1.03 of the theme or older. If you’re running WordPress 2.1 and Cutline 1.1, then you’ll want this file for random header generation.

Some Web hosts do not support WordPress 2.1 on certain plans (MediaTemple’s old shared server plan, for instance), and because of this, I’ve chosen to keep these files around for folks who don’t have any other options. Of course, I suppose you could always switch to MidPhase, the hostess with the most-ess, but then you’d have too much of a good thing, right?

Assumptions:

This special header.php file assumes that your images are named according to the following default convention:

  • header_1.jpg
  • header_2.jpg
  • header_3.jpg
  • header_4.jpg
  • header_5.jpg

Special Case Solution

The default code in this new header file should work for most people, but what if you want to use the random effect and you want special images to appear on certain pages?

I’ve got you covered.

For you special cases out there, I’ve prepared yet another header.php file that contains the necessary PHP and XHTML to accommodate your needs.

So, instead of using the file referenced above, use this one instead!

Download the new, special-case header image randomizer!

Update: Once again, I’m leaving this file here for legacy support only. If you’re running WordPress 2.1 and Cutline 1.1, then you’ll want this file for special random header generation.

It should be pretty straightforward, but if you have any questions at all, you know where to find me!

Tags:


155 Comments so far ↓

Leave a Reply to Watch Free Movie Online (Need help? Visit our Support page and Forums first.)