When Internet Explorer explodes your WordPress
I get up really early. 4am. Its my favourite time of the day. Perverse I know. It’s quiet apart from the occasional family snores, grunts, sneezes and snorts. Its a good time to get things done, unless Internet Explorer has exploded your WordPress.
I was doing my early rounds, checking my emails and replying to a HeatMap theme user who was having a few problems (in the end completely unrelated to Heatmap theme) when, during the search for the non-existent bug, I found a different bug altogether…
HeatMap Theme 2.2 coming soon (sort of)
I had recently upgraded all my sites to HeatMap Theme 2.2 (beta) (no you can’t have one yet…its not ready) and when I checked my sites using Internet Explorer I found to my complete horror, dismay, chagrin (cue gnashing of teeth) that my carefully constructed sites had exploded; CSS boxes all over the place. Aack! But ONLY on Internet Explorer (all versions – including the brand new exploder, version 8).
Normally I check and check things until they can be checked no more, but this one completely got by me. Maybe its because I secretly harbour a longing for a world where Internet Explorer does not exist (possibly this world, possibly around 1985, except that I’m still the age I was back then, but I know everything that I know now).
Why Internet Explorer exploded my WordPress
From a couple of hours of fossicking about, I now know that he problem was thus…
I had somehow managed to place a HTML comment right above the php call to get_header();
I don’t know why I got it into my head (no pun intended) to put the comment there, but I did do it, and it did explode my XHTML and CSS when viewed through the less-than-thrilling-to develop-for Internet Explorer. For those XHTML-o-files who like to nitpick, yes, I know its not really very good practice to put a comment there anyway, but it is easy to forget that the very top of your WordPress index.html file is actually the very top of your XHTML output in WordPress (because index.html calls header.php in the normal course of events – and not the other way round as might seem logical).
Anyway, the long and short of it is – don’t allow anything to appear in your code above the DOCTYPE (accidentally or intentionally) or you will incur the wrath of an exploded website on IE. All things being equal though, all the other browsers should have exploded too, but they were being very kind to my code, in a similar way to your friends politely ignoring your fart at a quiet afternoon tea.
This is as much a message to myself, as any other hapless WordPress / XHTML debuggee. Doh! Doh! Doh! (cue slapping of forehead).












