Wordpress plugin: Header Image Rotator

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:

  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.
Version 2.0 – 7-13-2008
    Too many updates to list. Hence, the new version number!

122 Responses to “Wordpress plugin: Header Image Rotator”


  • 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: http://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.

  • This works like a charm on WordPress 2.5. Thank you! :)

  • is there possible to link each image/picture to another site for instance?

  • How do I make it so the header image links back to the homepage?
    Thanks for this; you rock!

  • It works fine on Wordpress 2.5.1 (German Edition) – thank you for this plugin!

  • Great plugin! Question: How do I make it place an image in either the left or right side of my banner? What size does an image need to be to display completely? Mine are getting cropped.

  • Hi,
    I use a magazine theme on which doesn’t have header image. The header only display text (blog name and description). I tried to use this plugin and did all steps in your tutorial. But nothing shown in my header. Could you give me suggestion? Thank you

  • Very useful, thanks a lot.

  • Keep up the good work! 10q

  • Thanks for everything!
    Just wondering if it’s possible to link the header image back to the homepage?

  • I would like to swap the header image with the seasons. So have 4 in total for Spring,Summer,Autumn,Winter.

    Can I do this with this plug-in and how?

    Many thanks.

  • delete (clicking the X) of images from the admin panel doesn’t work.
    I’ve tried Safari 2.0.4 and FireFox 2.0.0.7 on OS X 10.4.9.
    under Wordpress 2.2. Suggestions?

  • I absolutely love this plugin! Great job! Check out what I did with it at: ncaafootballfreak.com

  • Installed and I can’t figure out what the css id would be if I’m using:

    #hd {
    background:transparent url(images/compheader2000px.jpg) no-repeat top left;

    as the way header images have been displayed so far without “Random Image Rotator” activated.

    I went through all of your instructions to see if the plugin was working, and it is.

    Thank you for this amazing plugin. I need lot’s of novelty and so does everybody else!

    Wendi
    innerstellarmedium.com

  • Downloaded, set up directory for photos, loaded a photo in directory 192×740 pixels, activated plugin and image appears. Problem – slight offset to the left about 1/8 inch of image? It hangs over the left side about an 1/8 inch. Strange?

    Gotta prepare a bunch of other photos to drop in. It’s a movies in the park project website, check it out.

    Thanks,

    A.G.

Leave a Reply