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.
Pingback: Wordpress con IE8 - URIELMANIA
Pingback: Internet Explorer 8 y WordPress | Amuzigi.com
Pingback: Para ir con los tiempos < Escandalera
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.
April 18, 2009 at 12:24 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
April 21, 2009 at 3:43 am
Anthony you can probably just copy that line into a file called
functions.php
and put it into your wordpress theme folder.
April 21, 2009 at 4:18 am
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.
May 29, 2009 at 10:33 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.
May 29, 2009 at 11:13 pm
you rock, _ck_ this is great!
June 21, 2009 at 7:15 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!!
August 26, 2009 at 1:00 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!! 🙂
September 5, 2009 at 10:50 am
Pingback: Turn on Chrome Frame for Internet Explorer in WordPress (and bbPress) « _ck_ says…
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
November 4, 2009 at 2:36 pm
thank you my admin.
November 29, 2009 at 6:02 pm
Your plung in works correctly!!!!! THANK YOU VERY MUCH!!!!!!! I’m so happy now!!!! :)))))))
June 6, 2010 at 2:00 pm
Many, many, many thanks
June 29, 2010 at 6:02 am
thx a lot! still I can’t believe:)
July 12, 2010 at 10:42 am
You just saved me from another day of searching for this fix, your the best.
Bob
July 23, 2010 at 4:09 pm
Hey!!1 this grate!!1
Como se dice en México… esto esta muy chingon!
bye
November 24, 2010 at 6:18 pm
i’ve used your code, and although it works, i can no longer log into wordpress anymore. is there something i can fix so that i can log into wordpress again? thanks!
Warning: Cannot modify header information – headers already sent by (output started at /home/content/27/4917527/html/WP/wp-content/plugins/explorer-fix/internet-fix.php:9) in /home/content/27/4917527/html/WP/wp-includes/pluggable.php on line 890
January 3, 2011 at 7:52 pm
That error often means you’ve simply put whitespace before the <?php
or after the ?> (either new lines or spaces).
Make sure you have nothing before or after the start and end of the plugin code.
January 21, 2011 at 3:58 am
hi molly, I receive the same error message!
It is perfectly normal when I check the site with chrome, however with ie, it is messed up!
January 11, 2011 at 8:15 am
Just after using your code I was unable to log back in this is what happens when I try on any browser now:
Warning: Cannot modify header information – headers already sent by (output started at /home/content/r/e/u/reubenroyce/html/wp-content/themes/mts-journey/functions.php:4) in /home/content/r/e/u/reubenroyce/html/wp-includes/pluggable.php on line 890
How do I fix that? Please help.
January 20, 2011 at 11:24 pm
That error often means you’ve simply put whitespace before the <?php or after the ?> (either spaces or new lines). Make sure you have nothing before or after the start and end.
January 21, 2011 at 3:57 am
So I havie no access to the server the blog is now hosted on. How do I fix it when I can not access it or log into it?
January 21, 2011 at 4:50 pm
If you cannot access your blog you should delete (or rename) the plugin via FTP access.
Assuming it’s the plugin that caused the problem, as soon as it’s deleted, it should return to normal.
Even if you do not have FTP access, many web hosting control panels give you simulated file access to delete or rename files via your browser.
January 21, 2011 at 4:57 pm
Great Thanks
January 28, 2011 at 8:27 pm
Well, CK, I gotta tell you that amount of excitement that I experienced when plugin worked – it is huge. Epic. Thank you. If you ever come to Croatia, you have a bottle of wine. Thank you very much for your effort and knowledge that you share.
March 16, 2011 at 6:36 am
Thank you! Thank you! THANK YOU! A new WordPress site I’m building (1st time WordPress user) was moving like a slug on IE8. I don’t even know enough about WP yet to get into template header. But I posted your code into the top of my “Home” page and presto, everything is just great! Shame that I couldn’t find anything on either the WordPress site or Microsoft’s — so again, Thank You Very Much!!! 🙂
April 9, 2011 at 5:09 pm
Works great! Thanks a lot! =)
April 13, 2011 at 1:13 pm
Wow.
Someone give this guy an award! 🙂
Such a simple piece of code.. WordPress should take notice!
April 18, 2011 at 3:20 pm
{{{hug!}}} I’ve been searching for a solution to the IE8 rendering issues for days, and your code inserted into my functions.php finally worked! Kudos!
May 1, 2011 at 12:23 am
I tried by editing the style.css file, but without success.
Thanks for the solution !
May 6, 2011 at 3:37 am
thanks !!! saved the site from the terrible woes of ie8!
May 12, 2011 at 10:57 am
You are a lifesaver! I hired freelancers that even couldn’t figure this out.
July 4, 2011 at 10:57 am
Doesn’t do it for me unfortunately.
Getting this 3 columns blog show properly in IE9 or Opera is a nightmare.
I had the template made with Artisteer, but I have been forced to switch to a ready made one and customise it. I’d have rather used my own design. But in these 2 browsers one entire widget column simply doesn’t show. Have the same problem using sufusion (ready made popular template).
If anyone found a solution to this I would very much appreciate a reply.
July 6, 2011 at 5:26 pm
Hi!
I just have problems with ie 6(what i know about). Do you have any solutions for that browser?
July 21, 2011 at 8:25 pm
I just spent something like 5 hours trying to figure this out. It was working on the front page for some reason, but no other pages. But this fixed it, and I really don’t understand why it did.
Thanks though!!
July 30, 2011 at 7:29 pm
Pingback: Cómo reparar un tema de Wordpress en IE « +Que Bits
Pingback: Wordpress Theme collaps into IE (internet explorer) « Marcelino CRM E-shop Wordpress Blog
Pingback: Wordpress Theme collaps into IE8 (Internet Explorer) | Marcelino
Thanks,
I use the lasy way and now it´s function well.
http://www.balloonenergia.com.br
September 14, 2011 at 8:49 am
HFS! That did it! you rock
September 21, 2011 at 6:04 pm
Your bug fix for IE Explorer worked like a charm! If there’s a Nobel prize for WP developers, you deserve it! Excellent advice!
October 13, 2011 at 12:53 pm
Hi. I’m putting the code in the fisrt line of the header but this error appears:
Parse error: syntax error, unexpected T_IF in /home/copiativ/public_html/wp-content/themes/twentyeleven/header.php on line 1
In the functions.php, i don’t know where to put this code, i’ve already tryed but doesn’t worked.
what do i do?
Tks!
October 19, 2011 at 8:02 am
life saver
November 5, 2011 at 5:21 pm
Pls , where can i find the functions.php in my wordpress theme, am using weaver theme.. pls reply asap!!! thanks bro!!
November 9, 2011 at 3:48 am
Hi CK;
I´m using your mini-plugin following your instructions and I can´t find the solution for prevent the changes between IE8 and wordpress.
I would like a reply with a post or an mail.
Thank you very much for your kindness.
Francisco.
December 2, 2011 at 5:21 pm
Keep in mind this plugin was meant for when IE8 was released to make a theme that worked with IE7 keep working with IE8
It’s not meant to address the numerous problems in general that IE8 has rendering a theme compared to Chrome or Firefox or Safari.
December 2, 2011 at 5:24 pm
This problem is in : http://www.revistacoiffure.com/
Thank you again.
Francisco
December 2, 2011 at 5:24 pm
wow It’ works! thx!
January 27, 2012 at 4:53 am
Very Very thanks.
You are my masteer
March 7, 2012 at 1:37 pm
сбережения сватьей зарей
May 22, 2012 at 11:38 am
спица мягкой награду
June 3, 2012 at 5:27 pm
небосклона управлять объективного
June 17, 2012 at 3:34 pm
I ve tried to instal the portion of code inside the very first line of header.php and functions.php but it doesn not work.
menu of my website http://www.tuscan-farmholiday.com is defently a mess with explorer 8.
Can you help me?
I will not offer you a bottle of win or beer but a discount for a stay in my resort!:-)
Thanks dear.
Otherwise just let me know if I can seriously commit this job to you to fix it.
Thanks.
August 1, 2012 at 6:21 am
Hi,
I have installed WPML to translate our site. I added the code and it seemed to help with the english version, but not the german (/de/). What is the best way to help this?
Our site is http://www.thelearningeye.com – thanks. Andy
August 28, 2012 at 4:56 am
it is really work thanks a lot
September 2, 2012 at 9:05 am