1

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

1
  • 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. ;)
    – fuxia
    Apr 11 '12 at 2:17
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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