19
Mar
09

How to fix Internet Explorer 8 messing up WordPress themes

Here’s a mini-plugin (single line of code actually) that will prevent the new IE8 (aka Internet Explorer 8 ) from messing up your carefully crafted WordPress or bbPress design.

<?php if (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 8")) {
header("X-UA-Compatible: IE=7");} ?>

Make a mini-plugin out of it and activate.
(you might be able to put it into functions.php if that executes before other data is sent but I am uncertain – for the extremely lazy you could in theory put it as the very very first line of header.php in your template)

I also have it listed as a more formal plugin over here

For those that don’t want to install IE8 permanently to just test their webpages, this version will run in it’s own virtual box so it doesn’t affect the rest of your system:
http://start-o.xenocode.com/layers/ie8/8-0-0-0__2/ie8.exe
There’s no install, it just runs instantly from that one file.


13 Responses to “How to fix Internet Explorer 8 messing up WordPress themes”


  1. April 18, 2009 at 12:24 am

    Thank you so much, this fixes the IE8 sIFR troubles on all my sites, cheers! If you’re ever in Sn Francisco the beer is on me.

  2. 2 Anthony
    April 21, 2009 at 3:43 am

    How to make a mini plugin?
    I have try to copy-paste that code to dreamweaver blank php file and save it. Then I upload to my wordpress blog, but the php file is not detected. What should I do?
    Thank’s

  3. April 21, 2009 at 4:18 am

    Anthony you can probably just copy that line into a file called
    functions.php
    and put it into your wordpress theme folder.

  4. 4 Alex
    May 29, 2009 at 10:33 pm

    Thank you so much for this tip. I was getting upset. I just installed Explorer 8 and it was rendering my Blog in a weird way. It rendered the text and took a lot of time to display pictures or the header. After putting that code in the functions.php file, it loads as before.

    Greetings,
    Alex.

  5. 5 Alex
    May 29, 2009 at 11:13 pm

    Is there a fix for the new FireFox?? I just noticed it render the page in a weird way too in the new 3.0.10 Firefox…

    It would be great to know what exactly is causing that problem.. something in the style css, not sure..

    it loads the page in a very weird way…

    Thanks.

  6. June 21, 2009 at 7:15 am

    you rock, _ck_ this is great!

  7. August 26, 2009 at 1:00 am

    your solution worked perfect!! Thank you so much!

    I just finished and tested my site for IE6, IE7, Safari, and FF on Mac & PC and worked out whatever little bugs I had with IE7. Then I tested on IE8 and just about flipped when everything rendered all weird…

    I hate internet exploder… each version just keeps getting worse **sigh** – the world needs to move to Firefox or any other standards compliant browser!!

  8. September 5, 2009 at 10:50 am

    My site receives millions of hits each month and I’ve been soooo frustrated with the way it looks in IE8. I had to put this code into my header.php because I already had a function.php file. AND IT WORKED!!!! THANK YOU THANK YOU THANK YOU THANK YOU!!! If you’re ever in Vegas, email me, and I’ll get you a beer as well!! :)

  9. November 4, 2009 at 2:36 pm

    hi,
    I tried everything but my site is not showing up, the video from youtube is floating all over the place its a issue only in IE rest the site is perfect…….please help

    moringaleaf.com


Leave a Reply




c

Blog Stats

  • 62,529 hits

 

March 2009
S M T W T F S
« Dec   Apr »
1234567
891011121314
15161718192021
22232425262728
293031