Archive for May, 2009

Quickly replace the header image in the default Wordpress 2.7 Kubrick theme

Posted in General on May 6th, 2009 by David – 3 Comments

I was asked to do some quick mods to client’s Wordpress blog. He wanted to replace the banner image. He’s using Wordpress 2.7 and has the default Kubrick theme.

This isn’t as easy as you would think as it’s generated by PHP so that the colours can be dynamically set.

Here’s what I did:

  1. Download wp-content/themes/default/images/kubrickheader.jpg
  2. Modify it, save and upload as wp-content/themes/default/images/kubrickheader_NEW.jpg
  3. Edit wp-content/themes/default/header.php. On line 42 you should see <div id=”headerimg”>
  4. Modify this so it reads:

<div id="headerimg" style="background: url(<?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader_NEW.jpg) no-repeat -1px 0">

Upload header.php and it should now be using your new header. I used the “-1px 0″ because the header was out of horizontal  alignment by 1 pixel. I don’t know if that’s because of the header image he sent or if that’s the way Wordpress’s dynamic banner image works. You might need to remove that part.

This probably isn’t the best way to do it but it’s a quick and easy solution.

Remove empty LEGEND tags in Silverstripe search form

Posted in silverstripe, xhtml on May 1st, 2009 by David – 3 Comments

I’m pretty obsessive about my HTML validating with no errors and no warnings. It bugs me that when I use Silverstripe’s incredibly convenient $Searchform in the template that it outputs an empty legend tag inside the fieldset.

There’s an easy way to fix this:

  1. Create a templates directory inside mysite.
  2. Copy sapphire/templates/SearchForm.ss to mysite/templates/SearchForm.ss
  3. Edit your copy of the file and remove that pesky <legend></legend> line
  4. Refresh your page that uses the searchform and bathe in the warm glow of a error and warning free page!

Thanks to Maksfeltrin in the Silverstripe forums for pointing this out.