O'Reilly logo

WordPress 2.8 Themes Cookbook by Lee Jordan, Nick Ohrn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up a randomly-rotating header image

To add some real design pizzazz to your WordPress theme, every time the page loads, you can randomly display different photos or other images in the header section of your theme. You can use this as a technique to generate interest for your visitors, or just as a fun personal experiment. With the method in this recipe, you'll be up and running in no time.

Getting started

You should have a basic theme skeleton created, in order to take advantage of this recipe. In addition, you should also have created a variety of possible header background images, preferably each of the same size.

How to do it...

For the purpose of this recipe, you'll be working under the assumption that you want to randomly rotate the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required