Modifications to Kubrick Theme

The default them for WP 1.5 is excellent, but I wanted a few things that were not standard. First thing I changed was making the sidebar available on all pages, I know there is now a default_allsidebar theme, but I made the alterations before this was out. I won’t go into detail but in many cases it was just the addition of < ?php get_sidebar(); ?> that did the trick.

I then added a navbar to the header.php file using David Appleyard’s tabs style sheet. This is a chieved by adding the relevent code to the header.php file and the additional styles to the style.css file.

The final mod was the header image, at first I simply pointed to my own image using *#headerimg { background: url('< ?php bloginfo('stylesheet_directory'); ?>/images/seorasheader.jpg') no-repeat top;}*/. Then I decide it would be nice to rotate the images. I was working on this when I came across Mike Cohen’s Random Image theme which was much better.

First add
< ?php
function header_graphic() {
echo "/images/";
$num=rand(0,9);
echo "seorasheader".$num.".jpg";
};
?>

to the header.php file which will randomly select an image from a bunch named seorasheader0.jpg –> seorasheader9.jpg.

Next, change the line in header.php

from:-
#header { background: url("< ?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader.jpg") no-repeat bottom center; }

to:-
#header { background: url("< ?php bloginfo('stylesheet_directory'); header_graphic(); ?>") no-repeat bottom center; }