NOTICE: The location of this plugin has been moved to www.WPImageRotator.com, a new site dedicated totally for the plugin! Please go there to get the plugin.
I recently finished my first Wordpress plugin titled the “Header Image Rotator”. What does it do? Well, like the title says, it rotates your blog header images. Why is this one different you may ask? Well, after being disappointed by the limited functionality of other header image plugins, I decided to create my own plugin.
Features:
- Add as many images as you like.
- Will take any kind of image file (jpg, gif, etc).
- The interval at which the images are rotated can be controlled.
- Different rotation intervals are minute, half hour, hour, daily, and weekly.
- You can preview your images and delete them from the option panel.
- Certified and tested in Wordpress 2.5.
- Works with PHP 4 and PHP 5.
- Streamlined the install process
- Cleaned up the options panel interface and made it easier to understand
- Cleaned up and organized error and exception handling
- Users now have the ability to change the CSS header tag directly from the plugin option page instead of having to manually edit the php file
- Users now also have the ability to manage and change the CSS image styling directly from the plugin option page so you can get the image to play nice with your theme
- Hyperlinking to your blog URL was added. Further, hyperlinking can be turned on and off from the options panel for more flexibility
- You can specify to use either the Google AJAX API to serve the jQuery javascript libraries or you can use a local version provided with the plugin. With this choice, you can select which method is better depending on your performance or bandwidth concerns
Installation:
Installation is simple and easy. Here are the steps:
- Download the zip file and unzip it into your /wp-content/plugins/ directory.
- Create a directory in your /wp-content/ folder named “header-images”.
- Add some images into the “header-images” folder.
- Activate the plugin from the admin panel.
- Go to ‘Options’ in the admin panel, and then ‘Header Image Rotator’ to configure.
- Enjoy!
Version History
Version 1.0 - 1/18/07
Plugin released and made compatible with PHP 4.
Version 1.1 - 3/7/07
Fixes function names that were interfering with other Wordpress Plugins.
Version 2.0 - 7-13-2008
Too many updates to list. Hence, the new version number!
















I was using Wordpress Random Header plugin. I tried modify it to change the header depending on time but I couldn’t finish it.
You’ve done my pending job, so let’s try it.
Thanks in advance.
Oops!
Fatal error: Call to undefined function: scandir() in …/wp-content/plugins/image-rotator/header-image-rotator.php on line 51
Thanks for the quick update.
I think it would be better to use CSS background-image: url() no-repeat; to change the header image instead of background: url() no-repeat;.
Otherwise if someone has another attribute in #header background, like a bckg color, is not shown.
this looks like it would be a great way to keep my blog looking fresh and new all the time. thx
question???do i need to edit the theme i’m using in any way? i noticed another comment that looks like it deals with the same issue, but i’m really new to this and need things explained more.right now it looks like this, but i’m guess i need to put something else there… background: url(’images/banner 6.jpg’) top left no-repeat;can someone e-mail me on this???
Hi again.
Since I installed image-rotator I didn’t access my permalinks option. But know that I’ve done it look what I’ve found:
Fatal error: Cannot redeclare add_js() (previously declared in /blog/wp-admin/options-permalink.php:9) in /blog/wp-content/plugins/image-rotator/header-image-rotator.php on line 154.
I’ve been years out of programming world so I don’t know now if what I’m going to say is nonsense.
Can I solve the problem changing function names in lines 153 and 248 of image-rotator.php ver 1.0?
Meanwhile I wait for your answer about the error in line 154 of header-image-rotator, I’ll activate again my old Random Header Plugin.
Thank you very much. I really liked the plugin. Let’s test it!
I have the same question that was stated earlier about using this plugin with one’s chose theme. The theme I’m using, hitch 1.0, has basic stylesheet in the theme folder, of course. what does one need to make the plugin and the theme play nicely together?
Permalinks page is working now. Thanks. Although now if I replace your CSS background: url() for background-image: url(), the header image does not appears.
My css template use a colored header this way: background: #8EBAFD;
I don’t know why when your plugin is working the background css (without color information) replace mine and then the header has a white background.
I know that’s so simple as add #8EBAFD into your plugin but the other way (using background-image) would be useful for any different color in any page of your blog template.
(I don’t know if I’ve explained myself correctly; we’re not used to speak in english here in Spain)
Do I have to add a CSS tag in my header?
This is what I’ve planned to add in my header.php :
This is my original header image:
I’ve installed the plugin, activate it, configure it properly but seems like not working.
Here’s my blog: http://dannyimages.com
looks like the html code was being filtered.
I’m planned to add this:
original header image:
Thank you for this awesome plugin, it’s the best random header plugin I have seen so far!
Thanks for the plugin, I’m using platinum v1.0 as my theme and although I can see the plugin is displaying the random headers it’s instantly being replaced by the default one, any ideas why?
I installed and activated the plugin with no problem, then added a few header images on my FTP server under content/header-images. I can see the images listed under Options > Header Image Rotator. So everything appears to be correct. But every time I refresh the site I get the same header image (the original one I was using). What am I doing wrong? Thanks in advance for your help! (By the way I’m using Regulus as my theme and I set the header rotator to One Minute. Thanks!)
i’m having the same problem !
did u solved ?
I hope so, I’m having the same trouble, the background colour overwrites the image. Do you know how to fix it?
I have it all installed and configured but it is not changing the header? What activates it? or is it suppose to be automatic? I am using Akon Theme for Wordpress
akon-082.
Thanks,
John
I use a Firefox plugin called Firebug to look at the CSS. It’s a very helpful tool. If you install the plugin you can inspect each css element on your main page. In looking at your site the CSS id is ‘headerimages’ instead of ‘header’. You will have to edit the header-image-rotator.php file and add your custom div id. In the hir_add_css() function, change the line ‘$headerID = get_option(’header_id’);’ to ‘$headerID = headerimages;’. Check it and the plugin should now be working. If not, let me know and we can tale a look again. Thanks!
-Matt
Ok thanks, I haven’t checked it out yet. After fooling around with the installed plugins yesterday I started having all kinds of problems. I just cleaned it all up and re-installed everything. I will make that change and give it a try. And thanks for the tip on the plugin for FF. Sound’s like a great tool.
John
Yes, I’m sorry to say it doesn’t seem to be working for me either. I’d be very grateful for any insight you can offer.
Also, I am wondering if there is an easy way to change the time frames to something shorter than a minute, for those who click through pages quickly. In fact, is it possible to change the image with each page visited? Or am I just looking for a different plug-in?
With thanks,
Myf
Thanks for that great plugin.
Just a little bug I have noticed which I cannot to manage to solve : if you use images in the header-images like the default kubrickheader.jpg image, then that header image seems to be very slightly shifted by 1 pixel on the right, thus not falling right on top of the body.
Would you have any ideas on solving that ?
[To see what happens, just put kubrickheader.jpg in the header-images folder.]
Thanks a lot !
i upload the files and everuthing works fine, but when i change the default id header of yours and i use mine that is #logo, images never load. i use a theme by fred blackphoto-10 is possible to help me fix this one?
Change all logo id’s and classes in your css file to header
It will support swf files?
hello, I’m looking for a plugin that change header image according to the page displayed. Can I modify this plugin to do that? Thanks
Hi,
Love this plugin. Thanks.
Question:
How to build a option to set a the swap value manualy?
for example “x” seconds.
I like to swap the header image every 5 seconds.
Also a idea is to use a nice effect during swapping.(fade in/out)
Hope to hear from you soon.
Thanks
hi,
I’m having a problem with this plugin - it works fine on some of the other themes I have installed, but not on my current theme. I can tell from testing on the others that I want it, but I don’t want to swap theme.
I’ve tried changing the $headerID line as mentioned above (to headerContent) but it doesn’t do anything. My site is at
www.bugpowderdust.co.uk/blog
if you’re not too busy I’d be grateful for some help.
thanks
Dan
Hi,
Your plugin sounds great.
Right now as I am learning I am trying
to keep these simple.
Do I understand correctly, that I can use
the WordPres Default 1.6 (Kubrick Theme) with
your plugin?
It would be great to be able rotate out of the basic header with a niche themed header image!
Thanks for your time.
Steve
Does this work with 2.2 default Kubrick?
I uploaded + in options > header image rotator it’s finding the images that were uploaded in the “header-images” folder, but, it’s not displaying the images on the blog…….
thanks for any help…..
kf
Hi,
It is possible to set the headerimage based on date? For example automaticly a different header between 15 and 26th of december?
Simulat code, but not for wordpress does exist for it. http://bonrouge.com/br.php?page=faq#time-pic
hi there!
first of all, great plugin, it works perfectly!
but is it possible to change the banner every second or every pageload?
thanks for your help!
cheers
Hi Mchl,
Maybe this can help you.
http://photomatt.net/scripts/randomimage/
If you put that as your header, it will change the image on everypage load.
Hi MHough,
Are you reading this and did you get my email?
Looks like a pretty cool plugin, but I doesn’t work here.
It seems like my theme (higherground-21) uses another CSS tag. But I can’t figure out what I have to edit in “header-image-rotator.php”.
Thanks,
Chris
Thanks a lot for this great plugin!!! ^____^
I’m not a programmer… I just try to change the header at my blog; I’d like a “random images header” but…
Fatal error: Cannot redeclare get_files() (previously declared in D:\Inetpub\webs\fotomigliocom\wp\wp-content\plugins\image-rotator\header-image-rotator.php:48) in D:\Inetpub\webs\fotomigliocom\wp\wp-content\plugins\image-rotator\header-image-rotator.php on line 48
thnx for answer
Thank you for your plugin, it works like a charm!
I have installed and activated the plugin with no problem, then added a few header images,content/header-images. I can see the images listed under Options > Header Image Rotator. So everything appears to be correct. No imagis are coming in the header. Thanks in advance for your help! (By the way I’m using Tiga 1.0.2 by Shamsul Azhar as my theme and I set the header rotator to One Minute. Thanks!)
First off, thank you for finally giving me a header rotator that works !
Second, are there plans to change the code so that a different header appears every time the page is refreshed? Instead of having to wait one minute or more?
Again, great job and thank you !
A header rotator that finally works!! Thanks for that.
I will tell to Barry: if you go in the plugin file you can change the half hour to 5 minutes so that can help. ’cause 1 minute are too short and half hour is too much. So you can put the level to 2, 3 or 5 minutes. After that you go to the plugin options section and change the level to half-hour but will display every 5 minutes a new header.
But… the great news is at this plugin is the first some work without complications. And the best thing are these: you can rename the CSS rule in the options zone. In my case #headerpic and work amazing. Thanks!! to MHough for developed these free tool for us.
Many thanks for the great plug-in. This version of random headers loads so much faster than my previous one.
Thanks for a great plugin!
I am trying to use this plugin with the MistLook theme from Sadish. Problem is it does not rotate the banner but instead puts the banner in the title bar instead. Any thoughts would be appreciated.
Mistylook theme: http://forums.wpthemes.info/?CategoryID=2
Craig… you must change the Div name. If you have a image in another place, if your header call #banner so you must put #banner in the image rotator options. Default are #header but you can change that value to any you will and will work. The important things is arrange the images to the place you will the rotation of images. I have try with 8 images and work amazing. In Mistylook the DIV name is #headerimage. So you must put that name in the options. Will work super after do that.
One more to Craig: In options panel… in header images rotator options… where say CSS header ID tag:headerimage and will be arranged.
Using the Kubrick theme, the header images appear shifted to the right by one pixel or so. I thought it might be my own images but if I put the default kubrickheader image in my images folder it shifts as well. Any help would be appreciated.
Greetings,
Thank you for the creation of the wonderful plugin and the help you’ve given everyone. I’m having issues myself.
Using cutline theme, I did this as recommended:
thanks for your comment. i looked at your site and it appears that your theme uses a different header class called ‘hid_1′. to fix this you will have the edit the header-image-rotator.php file. first, deactivate the plugin. open the header-image-rotator.php file and find the function hir_add_css(). in that function, find the line ‘#$headerID’ and change it to ‘.hid_1 #$headerID’ (without the quotation marks of course). reupload the file and reactivate the plugin and it should now be working. if you’re still having trouble please let me know. thanks for using the plugin!
But it’s still not functioning.
Here’s a snippet from the php:
}
function hir_add_css(){
$img = switch_image();
$headerID = get_option(’header_id’);
print
var img = new Image();
img.src = ‘$img’;
.hid_1 #$headerID
background: url(’$img’) no-repeat;
background-position: top left;
}
EOT;
}
function hir_add_js() {
print
—————————————————-
Any suggestions would be helpful. Thanks!
Hi,
Thanks for the great mod! One quick question though, before I installed the mod the gap between my header and my posts was about 25 pixels, now it has gone rather large
any ideas?
Cheers
Are there any variations of this plugin that allow the specification of which images appear on specific pages?
It’s not working for me .. it nudges the default theme image just about 2 pixels and that’s really ugly.. could you please tell me how to fix that ..what is different from the original image -they are exactly the same size..
Great plugin if it worked
I’ve fixed the problem myself and now it works like clockwork.. thanks again for a great plugin!
It was the the little bit of css that caused the trouble:
background: url(’$img’) no-repeat;
background-position: top left; ..-changed it to
background: url(’$img’) no-repeat;
background-position: bottom center;
Your industriousness has comped for my laziness- thanks!Great work!
Your plugin works great! I was using rotator code from some other site and I could not for the life get it to work right. I’m soooooooooo glad I found yours. Yours is the easiest to configure. I had it up and running in 5 minutes, if that. Rock on!
hi there - we would really like to use your header image rotater - we are using it on our kids school website, but it isn’t working… we did everything you said… can you please help us.
hopeless canadian moms - who should never mess with .php!!!
thanks man… and btw what is your name? matt, mike, mark, martin, marvin, melvin, milan, mitch….
Love the plugin. Only issue is that you lose the link back to homepage that was clickable on the header image if you use custom images and don’t use the Title label in the wordpress options. How do I get around this?
Still waiting for a response from my previous request.
By the way I’m also not getting the green checkmarks at self test.
Comment by Coach Steve Toth
2007-07-14 22:05:01
I have installed and activated the plugin with no problem, then added a few header images,content/header-images. I can see the images listed under Options > Header Image Rotator. So everything appears to be correct. No imagis are coming in the header. Thanks in advance for your help! (By the way I’m using Tiga 1.0.2 by Shamsul Azhar as my theme and I set the header rotator to One Minute. Thanks
thank you thank you thank you
Heya,
This plugin rocks. Thank you so much for sharing it.
QUESTION:
Is 60 the maximum number of images that can be shown? I’ve been adding more and more images to the header-images file and they all show up on the Options/Header Image Rotator page, yet once the rotation reaches the 60th image it starts over again at the top, neglecting the other images below.
Any ideas?
Thanks.
http://garlinggauge.com
I’d love to be able to use your image rotator, but the download page is just returning blank for me. I’m on IE7 on Vista if that matters. Thanks!
Hi,
Thank you very much for this plugin, You’ve helped me a lot. Here’s my site: www.habeo.atw.hu
Samu
I’m from Hungary. That’s a test blog page.
great plugin. worked perfectly. now time to create more images
http://www.nefariousgirl.com
Thank you, thank you, thank you. I love this plug-in - it’s so simple even a goof like me can use it. WAHOO!
Hi, I would very much like to use this plugin, but our page has far more than 60 headers. So is it true what Tortuca wrote?
Tortuca wrote:
Is 60 the maximum number of images that can be shown? I’ve been adding more and more images to the header-images file and they all show up on the Options/Header Image Rotator page, yet once the rotation reaches the 60th image it starts over again at the top, neglecting the other images below.
What a usefull plugin..Thx a lot
Cheers - this works a treat - and saves me doing different themes just to display a different header image!
In my case, I edited the php file so that the header is positioned at the bottom of the header - as I have the website name and search at the top.
Another user asked if would be best to have the Css call up the header image, but its best to display banners as an image, not background.
Also, the plug verifies as xhtml when its called up.
Thanks for the time and effort you put in to create this.
Warning: opendir(/home/nos10001/public_html/bernardoramirez/wp-content/header-images/) [function.opendir]: failed to open dir: Permission denied in /home/nos10001/public_html/bernardoramirez/wp-content/plugins/image-rotator/header-image-rotator.php on line 49
Warning: readdir(): supplied argument is not a valid Directory resource in /home/nos10001/public_html/bernardoramirez/wp-content/plugins/image-rotator/header-image-rotator.php on line 50
Warning: Invalid argument supplied for foreach() in /home/nos10001/public_html/bernardoramirez/wp-content/plugins/image-rotator/header-image-rotator.php on line 55
Can someone help me?
Your plugin works great with Wordpress 2.3.2. Thanks
Awesome, perfect for what I needed
Thanks.
erik
Is there any way to control size of banner at all, I`m finding when the page is resized you still get the original colour banner behind and to the sides?
Cheers
Do images need to be the same size? Is there an ability for the plugin to auto crop to a specified heightxwidth?
Thanks
Awesome plugin, adjusting few parameters and it can be use in sidebar and posts, adding an extra option to reload images with every page refresh would a plus.
Thanks
Fantastic- thanks so much.
I would also like to make this image (whichever is displayed) clickable back to my page’s homepage/root.
Can anyone help with this as noted above? I’m sure it’s a relatively easy change just not sure where/what to change.
Cheers
Using the Image Rotator, found via google search, thanks - I have a question though, do you think it would be able to add a line of code somewhere that makes the banner images clickable to return to the home page like usual?
hi, thanks for the plugin cool so far. everything went fine except that its not showing anything on the page.
Plz. Help.
hi just came across your “how to” page and solved the problem.
A cool idea. i am running PHPcode plugins. So if you can tell me how to insert the image swapping into a widget i can swap images in the sidebar and place it where i want it.
let me know and thanks again.