WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question

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

Your Answer


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.