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.

I want to load a different theme for those users who still use IE 6 - 7 - and 8 any plugin or code?

share|improve this question
    
Don't forget to set Cache-Control: private because you have to break every other cache to make browser sniffing work. It would better tough just to learn CSS. ;) –  toscho Apr 11 '12 at 2:17

1 Answer 1

Drop this inside a plugin:

add_filter('template', function($template){

  // could be IE
  if(preg_match('/MSIE [1-9]/i', $_SERVER['HTTP_USER_AGENT']))
    return 'your_ie_theme_name';

  // other
  return $template;

});

Just so you know, browser detection trough PHP is not really that accurate. There's a get_browser() function available PHP, not sure if it's any better though.

share|improve this answer

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.