My WordPress was very screwed up

Over the last few weeks I’ve been struggling with a series of problems with my WP installations. I have this one on the root of my site and another in a sub directory. This one was WP 2.1 and when I installed the one in the sub directory it was WP 2.2. Not long after I started getting weird errors, the most obvious was the Dashboard was all messed up in both installations and displayed the index page of this blog in pieces all over the place making the Dashboard unusable. After repeated emails to my host they could not come up with a solution. Eventually after trying just about everything I could think of I deleted both installations and the databases and rebuilt each from scratch adding data to the databases table by table. This did not work. I then deleted this installation and replaced it with WP 2.1.3 this seemed to fix some of the problems but gave me some problems with my previous posts, so this wasn’t a complete solution.

After trawling the WP support forums for the various problems I was facing I came across the explanation that the problem seemed to lay with Ajax in the admin interface. Then I found this explanation which didn’t actually work for me but it was further confirmation that the problem was Ajax related. Digging deeper in the support forums I found another solution posted by macbrink who suggested the problem was that some servers blocked the headers in update Ajax scripts. The solution was to add an .htaccess file to the wp-admin folder with the following code

<IfModule mod_security.c>
SecFilterInheritance Off
</IfModule>

I must admit I don’t fully understand the solution but all I can say is that it fixed all the problems I was experiencing in one fell swoop.

WordPress Themes, Plugins and XHTML Compliance

The vast majority of WordPress themes available today claim to be valid XHMTL, and indeed I have no reason to disbelieve any author who makes this statement. Problems seem to arise when you have a particular theme + a range of plugins activated and XHTML validity goes out the window. Now this may be caused by the theme, individual plugins, combinations of plugins or indeed certain theme/plugin combinations, I’m not sure. A recent example on my own site where one theme throws up 5 errors on W3C Validator and with the same plugin combination another theme throws 85 errors, whilst a 3rd has no errors. I won’t name the themes but you can see my point, as both themes claim to be valid XHTML. When a theme generates a small number of errors I will attempt to fix them but in cases where there are large numbers of errors I simply won’t bother.

WordPress Help

WordPress Help -Podz @ Tamba2

This is a a handy site dealing with all manner of things related to WordPress. There are quite a few here I hadn’t heard of or tried before. I’m certainly going to try the WordPress on a USB stick method. This could prove very useful for demonstration purposes.

Kubrick theme headers

A whole buch of images created to be used as headers in the kubrick theme.

Or you could use an image from Flickr as a kubrick header by using kubrickr

Or you could modify the header to load a random images of your choosing by :-

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; }

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; }