Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How could you detect a browser is using ie quirks/compatibilty mode and then switch themes if detected?

I've developed a nice new "responsive" theme for wordpress. It works great on mobiles & in all the browsers I've tested - firefox, chrome, even ie 6, 7, 8 & 9.

The only issue arises when using the compatibility mode in internet explorer - the site becomes "unresponsive" (divs & images not scaling properly).

For the moment I have disabled the compatibiltiy view completely with:

<meta http-equiv="X-UA-Compatible" content="IE=Edge" > 

So a couple of questions:

  • Should I expect responsive themes to work properly in ie compatibility mode?

  • How can I change to a different theme if compatibilty mode is selected?

Thanks

share|improve this question
add comment

1 Answer

If you're theme is working fine in IE 6, 7, 8 & 9 with compatibility mode disabled then you don't really need to have it enabled.

If you (try to) respect web standard, you can simply always use http-equiv="X-UA-Compatible" content="IE=edge". To keep compatibility with old browsers, just avoid using latest web features: use the subset supported by the oldest browser you want to support. Do not care about the best IE version rendering.

The positives sides of not having compatibility mode enabled has been discussed here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.