How to create a rotating header image in wordpress
by webgarden ~ April 1st, 2008. Filed under: Techy Stuff, php.There is tons of information about how to make a random image header in wordpress, and just as many plugins - however, I wanted to make my own rotating header image. If you are like me, and you want “complete control” over your site – here is the easy way to make a rotating / random header image:
- Create a folder called “header-images” & put your header images inside this folder
- Upload header-images to your wp-content folder
- Create a file called “rotate.php”
- Add the following code to your “rotate.php” page (you can copy and paste from here: http://ma.tt/scripts/randomimage/ )
- Upload rotate.php into the header-images folder (so that rotate.php is with all your images)
- In your theme’s “style.css” file find “#header”
- add the following code:
“background: url (…/header-images/rotate.php);” (this is telling your header to add the rotate.php as the background image) - Upload your css file
- Test your site and your finished!
Questions? Send me a message or a comment and I will do my best to help you out.