Wordpress plugin: Header Image Rotator

If you’re having trouble with this plugin please view my post on how to fix a common problem here.

     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.1.
  • Works with PHP 4 and PHP 5.

Installation:
Installation is simple and easy. Here are the steps:

  1. Download the zip file and unzip it into your /wp-content/plugins/ directory.
  2. Create a directory in your /wp-content/ folder named “header-images”.
  3. Add some images into the “header-images” folder.
  4. Activate the plugin from the admin panel.
  5. Go to ‘Options’ in the admin panel, and then ‘Header Image Rotator’ to configure.
  6. 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.

Download Here!
header image rotator

Downloaded 7298 times.

Spread the love

del.icio.us:Wordpress plugin: Header Image Rotator digg:Wordpress plugin: Header Image Rotator spurl:Wordpress plugin: Header Image Rotator wists:Wordpress plugin: Header Image Rotator simpy:Wordpress plugin: Header Image Rotator newsvine:Wordpress plugin: Header Image Rotator blinklist:Wordpress plugin: Header Image Rotator furl:Wordpress plugin: Header Image Rotator reddit:Wordpress plugin: Header Image Rotator fark:Wordpress plugin: Header Image Rotator blogmarks:Wordpress plugin: Header Image Rotator Y!:Wordpress plugin: Header Image Rotator smarking:Wordpress plugin: Header Image Rotator magnolia:Wordpress plugin: Header Image Rotator segnalo:Wordpress plugin: Header Image Rotator gifttagging:Wordpress plugin: Header Image Rotator

RSS feed | Trackback URI

128 Comments »

Comment by potaje.net
2007-02-20 11:59:42

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.

 
Comment by potaje.net
2007-02-20 12:16:50

Oops!

Fatal error: Call to undefined function: scandir() in …/wp-content/plugins/image-rotator/header-image-rotator.php on line 51

Comment by admin
2007-02-20 20:26:08

I originally wrote some of the functions of the plugin using the PHP 5 scandir() function. I modified the plugin and created a new function that should be compatible with PHP 4. Thanks for the bug report!

 
 
2007-02-21 01:23:30

[…] Header Image Rotator rotates your blog header images. […]

 
2007-02-21 02:25:56

[…] Header Image Rotator wechselt zwischen verschiedenen Bildern im Header. […]

 
Comment by potaje.net
2007-02-21 12:06:22

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.

 
2007-02-21 12:40:55

[…] Header Image Rotator permite rotar las imagenes del encabezado de tu blog. […]

 
2007-02-24 21:56:49

[…] Wordpress plugin: Header Image Rotator at MHough Plugin de Wordpress para poner un encabezado que va rotando al azar. (tags: wordpress plugin plugins images header rotator random) […]

 
Comment by vrtualme
2007-03-01 17:26:22

this looks like it would be a great way to keep my blog looking fresh and new all the time. thx

 
Comment by vrtualme
2007-03-01 19:51:51

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???

Comment by admin
2007-03-08 01:32:45

Hello, you shouldn’t have to directly modify your theme. The plugin will take care of that. If you have any other questions please let me know. Thanks!

 
 
Comment by potaje.net
2007-03-03 09:31:30

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.

Comment by admin
2007-03-08 01:30:34

Thanks again for the bug update. I made the correction and renamed some functions that seemed to be interfering with other Wordpress functions. If you have any other problems please let me know. Sorry for the late response I just moved and it took awhile to get online again. Thanks!

 
 
Comment by potaje.net
2007-03-03 09:41:10

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?

Comment by potaje.net
2007-03-07 09:17:23

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.

Comment by admin
2007-03-08 01:34:03

Please update to the new version, this should be corrected now. Thanks for calling the problem to my attention!

Comment by potaje.net
2007-03-08 10:36:53

Thank you very much. I really liked the plugin. Let’s test it!

(Comments wont nest below this level)
 
 
 
 
Comment by ByteDreams
2007-03-03 12:27:23

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?

Comment by admin
2007-03-08 01:37:08

Hello, you won’t need to edit your theme at all with the plugin. It should take care of that for you by dynamically inserting Javascript and CSS into the head. If you’re having problems it may be a theme compatibility issue. Send me more details and I’ll look into it further. Thanks!

 
 
Comment by potaje.net
2007-03-08 12:46:27

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)

 
2007-03-08 21:58:59

[…] notice that the header image sometimes changes with new visits. that’s due to matt’s Header Image Rotator. i think it’s totally nifty cool. he’s also been giving me some helpful advice on other […]

 
2007-03-12 18:41:49

[…] Header Image Rotator rotates your blog header images. […]

 
2007-03-19 01:19:30

[…] Wordpress plugin: Header Image Rotator at MHough ヘッダーイメージを変更するコトガデキルプラグイン。特徴は時間ごとに変更できるなど・・・ (tags: wordpress plugin image header) […]

 
Comment by Danny
2007-03-20 09:46:11

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

 
Comment by Danny
2007-03-20 09:47:36

looks like the html code was being filtered.

I’m planned to add this:

original header image:

 
Comment by David See
2007-03-29 09:57:31

Thank you for this awesome plugin, it’s the best random header plugin I have seen so far!

 
Comment by Dan
2007-03-29 19:05:47

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?

 
2007-04-01 08:31:09

[…] un nuevo plugin para las imagenes de la cabecera. Header Image Rotator permite escoger la frecuencia de cambio entre minutos, media hora, horario, diario o […]

 
Comment by Nathan
2007-04-01 16:35:34

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!)

Comment by ZeCompadre
2007-04-13 04:29:25

i’m having the same problem !

did u solved ?

Comment by admin
2007-04-13 15:12:34

hello there,

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!

-matt

 
 
 
Comment by Dan
2007-04-01 22:34:13

I hope so, I’m having the same trouble, the background colour overwrites the image. Do you know how to fix it?

 
2007-04-02 01:21:46

[…] Header Image Rotator rotates your blog header images. […]

 
Comment by John
2007-04-04 17:09:11

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

Comment by Matt
2007-04-05 10:19:01

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

Comment by John
2007-04-05 15:04:14

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

 
 
 
2007-04-10 00:12:40

[…] Header Image Rotator rotates your blog header images. […]

 
2007-04-10 23:21:53

[…] Header Image Rotator rotates your blog header images. […]

 
Comment by Myf
2007-04-18 15:37:04

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

 
Comment by Seb
2007-04-19 01:29:46

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 !

 
2007-04-25 19:41:26

[…] Wordpress plugin: Header Image Rotator at MHough # 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 i (tags: wordpress plugin image plugins rotator header images blog web) […]

 
2007-04-29 05:24:43

[…] ダウンロード:Wordpress plugin: Header Image Rotator at MHough […]

 
Comment by LAZAROS
2007-04-29 09:51:32

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?

Comment by ArjanV
2007-05-16 12:19:16

Change all logo id’s and classes in your css file to header

 
 
Comment by Myquestion
2007-05-05 12:34:56

It will support swf files?

 
Comment by Thale
2007-05-09 03:19:33

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

 
Comment by arjanv
2007-05-09 10:06:59

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

 
Comment by dan
2007-05-14 09:41:55

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

 
Comment by Steve
2007-05-24 19:50:15

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

 
Comment by kbf
2007-05-27 13:53:47

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

 
Comment by John
2007-05-28 18:17:07

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

 
Comment by mchl
2007-05-31 10:06:26

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

 
Comment by John
2007-06-01 05:20:18

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.

 
Comment by John
2007-06-04 04:17:24

Hi MHough,

Are you reading this and did you get my email?

 
Comment by Chris
2007-06-05 16:58:56

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

 
Comment by Ikoro
2007-07-05 14:30:23

Thanks a lot for this great plugin!!! ^____^

 
Comment by ale
2007-07-12 06:25:56

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

 
Comment by Dondo
2007-07-14 16:54:45

Thank you for your plugin, it works like a charm!

 
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!)

 
Comment by Barry
2007-07-29 10:01:40

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 !

 
Comment by Jan
2007-07-29 21:04:21

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.

 
Comment by hotspur.us
2007-07-30 01:27:33

Many thanks for the great plug-in. This version of random headers loads so much faster than my previous one.

 
Comment by craig
2007-07-31 16:07:44

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

 
Comment by Jan
2007-08-01 17:43:03

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.

 
Comment by Jan
2007-08-01 17:48:00

One more to Craig: In options panel… in header images rotator options… where say CSS header ID tag:headerimage and will be arranged.

 
Comment by Kevin
2007-08-07 18:15:59

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.

 
2007-08-09 01:56:33

[…] rollo está basado en la estructura del plugin Header Image Rotator de MHough modificado y desarrollado por Zetxek. Pero lo mejor es que visites su blog porque él […]

 
2007-08-09 19:59:12

[…] Visit […]

 
Comment by Tony
2007-08-09 21:26:30

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!

 
Comment by Ross
2007-08-10 16:36:52

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

 
Comment by John
2007-08-15 12:53:32

Are there any variations of this plugin that allow the specification of which images appear on specific pages?

 
2007-08-18 07:33:57

[…] Header Image Rotator WordPress Plugin allows you to add an unlimited number of header images in just about any file type. You can control the rotation intervals precisely, even to changing daily or weekly. Images can be previewed and deleted from the Administration Panels. And best of all, it works in WordPress 2.1. […]

 
2007-08-22 01:12:06

[…] usando um plugin para que o layout do site use imagens aletórias no cabeçalho. Todas fotos tiradas por mim ou pelo […]

 
2007-08-22 07:58:18

[…] Header Image Rotator: There are a number of chibis rotating above, thanks to this plugin. Quite simple to use, and the plugin lets you set the update frequency. […]

 
Comment by NordArt
2007-09-01 15:46:42

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

 
Comment by NordArt
2007-09-01 15:56:45

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;

 
Comment by Phil
2007-09-02 19:08:58

Your industriousness has comped for my laziness- thanks!Great work!

 
2007-09-08 03:19:19

[…] 8. He añadido un plugin para que la cabecera vaya cambiando, no había encontrado ninguno que me gustara pero al fín lo encontré: Header Image Rotator. […]

 
2007-09-12 12:22:51

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!

 
Comment by karen
2007-09-24 19:45:03

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….

 
Comment by Derek
2007-09-29 20:59:49

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?

 
Comment by Coach Steve Toth
2007-10-10 00:36:33

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

 
Comment by ian
2007-10-16 08:47:12

thank you thank you thank you

 
Comment by Tortuca
2007-10-26 22:09:38

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

 
Comment by Jeremy
2007-11-10 19:58:55

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!

 
Comment by Samu
2007-11-11 05:54:43

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.

 
2007-11-11 16:08:55

[…] I found a great way to manage the header image in your blog.  I found the plugin Header Image Rotator at http://mhough.com/wordpress/2007/header-image-rotator-plugin/ .  […]

 
Comment by civs
2007-11-15 18:21:33

great plugin. worked perfectly. now time to create more images :)

http://www.nefariousgirl.com