Archived Page

You're reading an archived page of the site. The content is probably out of date. Try the homepage for more current content.

WP Random Header

A simple plugin that uses randomly picks a header image from the files in wp-content/header-images. Install, activate, that’s it.

Put only image files in wp-content/header-images. The plugin will choose any files from that directory, so other file types will mess things up.

The plugin only sets the image url, not the size, so all images should be the same size and the same size as the standard image header for your theme. That’s 1000×288 for twentyeleven or 940×198 for twentyten.

The plugin does not deactivate the custom header image functions of any themes. So your theme might still allow you to set the image header, but this plugin will most likely override it.

Support

If you cannot make this plugin work, please try another. I’m not willing to provide support for this plugin. Please respect that decision and do not ask support questions of me. If you find a bug, or the plugin does something you think it shouldn’t, please let me know in the comments here. Also, if you’d like to take over maintenance of this plugin and provide support, let me know. 🙂

Download

Get the code on wordpress.org.

Comments

Callum at 2012-02-13 10:37:15

RTFM. <blockquote>If you cannot make this plugin work, please try another. I’m not willing to provide support for this plugin. Please respect that decision and do not ask support questions of me.</blockquote>

Bruce Wampler at 2010-07-05 02:20:59

So I looked at the code for both the WP.org download and your site's download. That code is obviously the wrong stuff. The example I sent earlier is the result of a var_dump on an array that is not even initialized to anything. Would like to see the real plugin that generates the random header for your site. And I might be willing to take it over.

Callum at 2010-07-05 04:05:39

You're absolutely right, my apologies. I committed the wrong code altogether. That was an early version. I've committed the most recent code now, it's in svn and I think it'll be on wp.org within an hour or so. Let me know how you get on with it.

Ruby at 2010-07-17 12:26:34

Hi, this works perfectly and was exactly what I was looking for. Just wanted to say thanks! :)

Callum at 2010-09-22 21:15:58

Simple answer, I'm not sure. You could install and test. There might be a solution around setting the priority for the 'theme_mod_header_image' filter. If it does override a specific post image, I'll consider that a bug and try to find a simple fix. I can't promise how quickly I'll be able to do that though. Please let me know if you're able to test it.

Grady at 2010-09-22 21:22:49

It works great, at least with the twenty ten theme. Actually just finished trying it out when you posted that reply. So, here's the deal: Install it as directed If you have a post/page you want to set a featured image, just do so &amp; it will over-ride the random header.. Have no idea about other themes though..

Callum at 2010-09-22 21:34:36

Sweet, glad it "just works". :-)

Callum at 2010-07-17 13:40:22

Great, glad it works for you, thanks for sharing your feedback, I appreciate it.

Rick at 2011-03-24 06:04:55

I tied using your script, but sadly it doesn't work for the Arras WordPress Theme.

Bruce Wampler at 2010-07-05 11:44:11

Thanks - Works perfectly with my Twenty Ten child theme, and I posted a plug on my theme's site: <a href="http://wpweaver.info/tip-random-header-image/" rel="nofollow">Tip: Random Header Image</a>

robert chun at 2011-02-17 08:15:27

Hey Callum great work! I have uploaded the plugin and followed your directions exactly, it works fine but sometimes my images will come out distorted or pixelated. (maybe like 10% of the time) The pictures are to perfect size and im extremely confused! if you could help me out that would be so great!

Grady at 2010-09-22 17:57:03

Just wondering if this plugin over-rides the ability to have a default image for a specific post or page? I would like to have random images on most of the site but on pages/posts specific to one of my projects I would like to set the image to that particular project. Thanks.

Cora at 2010-11-07 12:43:29

Just wanted to let you know that I'm using your plugin with twenty-ten and it works great. My blog now has a lovely selection of rotating header images.

Callum at 2010-07-05 18:43:31

Sweet, glad you got it working, thanks for the plug. :-)

pendleton at 2010-07-15 02:12:24

Hi. I know there's no support for this, but maybe someone else out there who uses this plug-in can help...? I want to know if there is anyway to add a default image? In other words, is there a way to have one image appear the first time the page is loaded and then as the page is reloaded the images are randomly chosen? Also...is there any kind of timer that can be implemented so that there is an option to be more like a slideshow? -just curious - thanks!

Callum at 2011-02-18 17:45:32

Can you figure out why the images are distorted? In Firefox, if you right click on the picture and click "View image" that should load the image alone. Then you can check the URL and see if it's a proper image. Try also pressing CTRL-SHIFT-R, which will hard refresh (bypassing the browser cache). If the image reloads properly, it's a cache corruption or a browser issue. If you find something else wrong, let me know and maybe I can point you in the right direction. From what you've said about the issue, there's no reason the plugin would cause that issue.

Joël at 2010-12-10 15:10:06

Thanks, I saw it was working with twenty ten, so I tried with F8lite and it works ! Great job you did !

Callum at 2010-07-16 08:42:50

These features will exist if you wish to write the code, today, these options do not exist and I have no plans to implement them.

Joerg at 2012-05-09 12:03:00

Hi, as I can see pictures rare taken from this source: wp-content/header-images Would it be possible to get pictures from a different location? The reason for asking is, if (like I do) have a WP multisite setup, all blogs using the plugin would have the same images to be displayed. Please don't comment and shout at me with your RTFM etc. comment, unfortunately there is no plugin having the ability to setup different random header sets or 'let's call it groups by folder' or similar to achieve having different blogs with different images. Cheers Joerg

Callum at 2011-03-02 20:21:59

Are you asking for support? I deleted your earlier comment because I couldn't see the relevance, the email you gave appears to be fake and so I thought your comment was link spam.

Anne at 2011-05-09 23:03:47

Thank! Youare a star. This plugin is so easy and very effective! Regards, Anne

Callum at 2011-07-28 18:06:05

That would make sense as a separate plugin I think. To fade in / out would require javascript or creating animaged gifs (a horrible option). The javascript approach would be quite different to how this plugin works, so I can't imagine it would end up in the same plugin. But it's definitely possible. If you're willing to fund the development, we could discuss privately in more detail.

Callum at 2012-05-09 13:56:19

You could write this functionality easily enough. If you'd like me to assist, we can discuss rates, etc privately.

fotoshotter at 2011-03-02 11:43:03

Thanks very much for sharing!!!! I'll try put this plugin at www.blog.unavitaverde.net

Callum at 2011-05-21 10:12:51

The answer is no, please do not ask again.

Tournas Dimitrios at 2011-06-05 07:52:07

Hi , Your plugin is excellent . Unfortunately it's not working on the Thesis framework . Thanks anyway :)

Callum at 2011-02-22 10:17:40

Absolutely not. This plugin uses a feature built into WordPress to select a header image at random. Causing the head image to change in place would require a totally different approach, probably based on javascript. It's not something I can ever see adding to this plugin. However, it would be reasonably easy to implement, if you can't find a plugin that does this I think it would be easy to commission one on the likes of vWorker.

Lisa at 2011-02-22 13:42:00

Got it. Thanks so much for your response. However, I do not understand "vWorker". Is that a site or a component of WordPress? Thanks again. Lisa

Max at 2011-02-04 11:36:08

Hi, I have installed your plugin with Twenty Ten. There appears to be no way of uploading more than one header image, please advise? I notice that others have got it to work.

Callum at 2011-02-04 11:51:16

As per the first sentence on this page, the images go into wp-content/header-images. Have you put multiple images in a folder called header-images inside the wp-content folder? There is no way that I know of to upload the images through WordPress. I believe you'll need to put them onto your server by FTP or some other means.

robert chun at 2011-02-20 00:23:25

Thanks so much dude!

Lisa at 2011-02-22 04:08:41

I love this plug in, but is there a way to make the images rotate without reloading? I mean can they rotate in 2 to 3 second intervals? Thanks, Lisa

Renee at 2011-08-20 11:17:26

Hi, I've just installed your plugin and it's great. I'm new to WP, please can you tell me how I can remove some of the images I have uploaded that I do not wish to use in the rotation.

Lisa at 2011-02-22 13:54:54

Never mind on the vWorker response. I Googled it and see it is a site whereby I can post projects to be done and receive bids on them. Thanks bunches for the tip. Best, Lisa

Terry at 2011-02-07 17:13:15

Callum, thank you for writing such an elegant and simple piece of code that saves folks hundreds of man-hours from needing to reinvent the wheel every time this kind of functionality is wanted. I ran into a problem that I was able to troubleshoot myself and wanted to point out to others just in case they face the same problem. This script will grab and post ANYTHING you put into the wp-content/header-images, so make sure it's completely empty except for the images you want displayed. While constructing a site using XAMPP on an XP box I kept randomly finding the header space blank (just white background) instead of a picture loading. After a day of thinking about it, I forgot that Windows likes to do crazy stuff sometimes, like add hidden files to folders (in this case a hidden thumbs.db). So if you're testing on a Windows environment and face the same problem, check to make sure you don't have hidden files in the header-images folder. Thanks again!

Callum at 2011-02-07 17:21:29

Thanks for the kind words, and thanks for sharing your experience. I hadn't thought about Windows hosts, you make an excellent point. I knew the plugin picked up any type of file in the directory. I could have written something to check for images only, but to do that properly would require quite a bit of thought and code. I wrote this really for my own use and I know to keep the directory clean, so it's not an issue for me. Glad you figured out the challenge. I'll maybe add something to the documentation to make this point clearer, that's probably a good idea.

M. Douglas Wray at 2011-01-24 00:23:59

Thank you for giving us this plugin! It works flawlessly and exactly as advertised. I am in your debt sir.

gino at 2012-02-10 19:40:43

Hi there Ive got the weaver theme as my activated theme. I cant see where it is even when ive activated the random header plugin. Could you please give me some advice?

Molly at 2011-07-27 20:04:06

Great plugin! Very easy to install. Just mentioning this in case anyone gets inspired to write some fade-in/fade-out code for this plugin. I'd be very interested.

Callum at 2011-05-21 00:45:41

The plugin does not do that. It's not related to the functionality of this plugin so I won't add it at this time.

AlexG at 2011-05-21 02:18:51

please! do it! I will be incredibly grateful! tell here when you're done please! thank you!

AlexG at 2011-05-20 23:06:27

Can I make the header of the site has become clickable and when you click on header it moved us to the homepage or something URL? (sorry my english is bad)

AlexG at 2011-05-20 23:11:11

I want to know how i can make it. When you are click on header images - you will moved on homepage. Its simple. if you can do it, please. All people want it.

Callum at 2011-05-20 18:53:02

I'm sorry, I don't understand your question. I'm guessing that the plugin doesn't do what you want. It only randomises the header image, it doesn't do anything with links and so on.

AlexG at 2011-05-20 18:18:13

Hi! I have set your cool plugin on my site. How i can when i clicking on the image in the header to move to the home page? i wanna see active header with link on home page. thnx

Larry at 2011-09-12 04:49:49

Hello I need advice the plugin works on some of my sites but when the css looks like this /* begin Header */ div.art-Header { margin: 0 auto; position: relative; z-index:0; width: 870px; height: 250px; } div.art-Header-png { position: absolute; z-index:-2; top: 0; left: 0; width: 870px; height: 250px; background-image: url('images/Header.png'); background-repeat: no-repeat; background-position: left top; } div.art-Header-jpeg { position: absolute; z-index:-1; top: 0; left: 0; width: 870px; height: 250px; background-image: url('images/Header.jpg'); background-repeat: no-repeat; background-position: center center; } /* end Header */ I do not what to enter for it to work for me Can you please help me out. Thank you

Callum at 2011-09-12 11:03:08

RTFM: "If you cannot make this plugin work, please try another. I’m not willing to provide support for this plugin. Please respect that decision and do not ask support questions of me."

Callum at 2011-06-04 10:25:35

Downgrade to 3.1.2. Does your problem go away? If not, the problem is not v3.1.3.

Jimmi Povlsen at 2011-06-02 22:44:58

I've updated to wp 3.1.3 and now the wp header plugin no longer works. Have you got any solution for that problem?

Callum at 2011-08-21 14:49:42

From the top of this page: "If you cannot make this plugin work, please try another. I’m not willing to provide support for this plugin. Please respect that decision and do not ask support questions of me."

Lynsey at 2012-01-05 23:24:37

Callum, thank you for the plugin. I was a bit nervous about the 'no support' disclaimer (btw, reading some of the comments here I can see why you'd say that); however I've just installed the plugin, followed the instructions, and it works just fine. So, for people struggling to make the plugin work, here's what I did: Use the Twenty Ten theme - I had troubles using other themes. Load a selection of .jpg images sized 940×198 pixels into a directory/folder called 'header-images' located just inside the wp-content directory/folder. Install and activate the plugin. View your site's pages/posts. If the images are 'sticking' i.e. not changing, try forcing a reload from the server - ctrl-f5 (pc) or opt-r (mac). Thanks again, Callum, keep up the good work.

Chrus at 2011-10-21 00:33:33

Just wanted to say thanks man, really useful plugin that does a perfect job.

Callum at 2012-01-07 15:28:27

Awesome, thanks for sharing. Great to get helpful comments from folks. :-)

Carl at 2012-11-01 22:29:48

Thank you, just what I needed! I'm using it with Pico Light, which looks like a child of 2011. The stock WP random image picker is slow, hard to change or adjust, and corrupts if there are certain server changes made. And the stock images are hard-coded, very helpful!

Johan at 2013-04-27 23:06:45

Hello, Thanks for the plugin. Working perfectly on my new site

Callum at 2014-06-09 19:49:57

Sure thing, shoot me an email (a reply to the comment notification should work) and we can discuss your precise requirements.

Karel at 2014-06-08 11:52:45

Yah, I'd be willing to pay for it to work separately on a multi site, as I am building http://offthewhitemonkeyroad.com/. Would like a different set of rotating pictures for each country. Give each country a different feel as people are traveling virtually. Works great with this theme Landscape, by the way. :)

Astrid at 2013-09-04 13:34:49

thank you for the plugin, it works perfect with my Theme zeeCorporate (900x140 pixels)

Luca at 2014-12-12 19:59:00

Hi man! I was wondering if WP Random Header works with Wordpress sites with Network enabled. I've used the plugin on other sites and it's brilliant! Now I've a networked Wordpress site with multiple blogs. And I'd like to have a standard layout for all blogs, including having the your Header in all of them. Do you think it'll work? I just tried but I can't see the header showing up... thoughts? thanks!