How to display random header images in K2 theme of WordPress

Maybe you already knew, but I just found out from my own experience. This afternoon, I tried to update the header image for this blog. I went into the back-end Dashboard, then click Presentation –>Custom Image Header. There I uploaded a new image, and got the confirmation message. But when I came to my live site, I still saw the old header image. No matter how many time I refreshed the screen, and I also purged the browser cache too. When I thought it was the bug of my K2 plugin/theme, I uploaded another new image but amazingly I saw the second image appeared when I refreshed the screen (I was supposed to see the third one)!

Interesting, so I decided to find out what was going on. When I FTP-ed into the site, and went to the directory of \blog\wp-contents\themes\k2\images\header. I found all three images I previously uploaded with the Dashboard. I could not help but thinking how K2 knows which image is my latest image header if all they are kept the original file names and in the same image directory. The possibilities are two: 1) there is a database function to track which image header should be right one. But it is hard to do so if all WordPress pages depend on the CSS file alone to display the style. Then 2) the K2 might display all header images in this directory by random.

To prove my thought, I used the FTP software to upload another image file directly to this directory I mentioned above. And when I come back to the live site and refresh my browser, I really see these four images show by random. Haha, I did not know this Easter Egg when I installed K2 theme.

Anyhow, to summarize what I found out on how to display your header images in K2 theme:

  1. Prepare as many images as you like and find. And the image size is better to be 950 x 200.
  2. Use the dashboard of WordPress or FTP (I prefer FTP) to upload these image files to the folder of \wp-contents\themes\k2\images\header
Tags: , , ,

Related posts

5 Responses to “How to display random header images in K2 theme of WordPress”


  1. 1 Nic Bedford

    Hi, I really like the K2 header image you have with the tap on it, can you tell me is there any copyright on this image (either by you or someone else) or can i use this image on my wordpress based blog too?

    Thanks, Nic

    [ Reply ]

    WebGuru replied on July 23, 2008:

    You can use it which is copyright free.

  2. 2 GLaDOS

    Hi.
    I don’t have the wp-content\themes\k2\images\header but i have
    wp-contents\themes\k2\images\ without the header folder.
    I’m using norblogg.net. It’s at Norwegian site thats hosting free wordpress blogs so I don’t have actually any FTP browsing system I guess or I just not found it yet. I would be GLaD if this random header thing would work :)

    [ Reply ]

    WebGuru replied on December 20, 2008:

    If you can not FTP, then use K2 Dashboard to upload more images and see whether that works for you.

  3. 3 GLaDOS

    That will not help. It only show the last uploaded image.

    [ Reply ]

Leave a Reply