How to create a random banner in WordPress

Update:
At the bottom of this page you can find a simpler solution to this question.

Update2:
I have currently removed the random banner from my design. Not because it didn’t work well, but because I wanted a simpler design.

As you might have noticed, the banner at the top of this site changes as you navigate the site. To implement this in WordPress is quite simple.

You need this plugin:
Random Banner
Random banner how to install

And a couple of banners. I made mine with a template I made in Photoshop. You can download my template here:
Template to edit the default banner in WordPress

Or you can make a couple of banners using this tool:
flickr-to-WP-banner

When you have set up Random Banner and made some top banners, place them in the random banner folder as noted in the instructions for the plugin.

Activate the Random Banner plugin.

Now you need to edit line number 27 in “header.php” for your current theme. You should replace the existing line 27 with this one:
#header { background: url("") no-repeat bottom center; }

NOTE: I have not bothered to install a plugin that lets me print pure PHP-code on my page, so you can not copy line 27 directly from here. You need to delete the space between < and ? before "php random_banner…"

…and off you go!

You can read about my current banners here.

How to create a random banner in WordPress

WordPress 1.5 so far

I switched from MovableType 3.14 to WordPress 1.5 a couple of weeks ago. I actually paid for a license of MT, but still I was tempted to try WordPress. Both because DreamHost offer One-Click install of WP and because I never really felt like home in PERL-based MovableType. Its like a friend of mine, Trond Isaksen says “PERL is 20% programming and 80% Magic”. Well, Trond is a wizard, and masters PERL perfectly well. I am not a wizard. I am not even a programmer. I have done my share of basic, assembly, pascal and C, but I am not a programmer.

And what do I feel about the switch? I feel good! I feel that I have much more control of what is happening now by using WordPress. I have even done some modifications and can conclude that PHP is not so much about magic. It is actually possible to understand.

Plugins like BAStats, Exhibit and the rest of the stuff from Owen Winkler alone makes it very difficult to choose another publishing tool.

BAStats gives you nice and accurate trafic data right in your WordPress administration GUI.

©2005

Exhibit gives you an excellent tool to upload and manage pictures in your blog. Also directly from your WordPress administration GUI.

The fact that WordPress actually is free makes the world a better place to live. So, if we could get world peace and no hunger then we are all set. 😉

A friend of mine, Øystein has set up a good starting point for people that want to try out WordPress: Customize wordpress.

WordPress 1.5 so far

An update on BotCheck for WordPress 1.5

It seems like I wasn’t that stupid after all:

Thanks to Eirikso for catching a mistake in the new install instructions for Bot-Check in WordPress 1.5. The old instructions have you remove an if statment that checks for a logged in user. A new download has been put up with correct install instructions.

To fix:

Add

Right before the line

Logged in as …

So, now I am up and running with the latest version of BotCheck and can recommend this little plugin for everyone running WordPress 1.5!

Related post:
BotCheck for WordPress 1.5

An update on BotCheck for WordPress 1.5

BotCheck for WordPress 1.5

Edit:
I have had problems with BotCheck preventing trackbacks. I have deactivated it and try another plugin. More on that issue here!

You find an update on this issue here:
BotCheck 1.1 fixed

BotCheck

I am using BotCheck to prevent comment spam. This works fine in WordPress 1.5. I had to do some small changes to get BotCheck Version 1.0 work in 1.5

You have to change the comments.php-file in your current theme directory. My comments.php look like this:
comments.php

So, it works and I am happy, but BotCheck is now upgraded to version 1.1. So, I tried to upgrade, but got an error:

Parse error: parse error, unexpected T_ELSE in
…../wp-content/themes/wwweiriksocom/comments.php on line 98

Somebody at some point said “if it works, don’t fix it”, so I am back to version 1.0 with the fix in my comments.php mentioned here.

I will check back to www.blueeye.us to see if someone replies to my comment. I have probably done something very stupid, and the fix is probably very easy…

BotCheck for WordPress 1.5

How to install the Exhibit plugin in WordPress 1.5 on Dreamhost

It is a completely and utterly fantastic plugin for WordPress. It makes it extremely easy to upload pictures, make thumbnails, downscale and watermark. All from the standard WordPress web GUI in a very user friendly system.

It took some time before I could find the controls in the WEB-gui. I had to apply a fix for the way DreamHost run PHP. What you do is:

For Exhibit, you might find this useful (a user[1] contribution to Dreamhost’s really quite useful[2] KnowledgeBase)

In exhibit10.php, there is a block of code near the very beginning (line 46) that says:

$_SERVER[‘SCRIPT_NAME’]=

$_SERVER[‘REQUEST_URI’]);

Remove that whole block and replace it with:

$_SERVER[‘SCRIPT_NAME’] = $_SERVER[‘SCRIPT_URL’];

Before I found that, I couldn’t get Exhibit to appear in the admin interface

[1] Not me – found it after much head-scratching and googling
[2] Understatement – it’s an excellent resource for DH users

In addition to this you have to do a fix for WordPress 1.5:

In the file “exhibit10.php”, around line 130, you should find this line:

$this->tableexhibit = $table_prefix . $this->exhibit_db_table;

I replaced this line with this:

$this->tableexhibit = “wp_exhibit”;

I found these fixes here:
http://wordpress.org/support/topic.php?id=8501
And here:
http://wordpress.org/support/topic.php?id=24124#post-136294

The thumbnails at the top of this post are inserted using the Exhibit plugin.

How to install the Exhibit plugin in WordPress 1.5 on Dreamhost