Serve IE6 Visitors the Default WordPress Theme

IE6 is somehow still some users browser of choice, or are restricted by work computers that still run IE6.

This snippet will force IE6 users to view the default template leaving your design viewable by users with modern browsers only, thus saving time on IE6 bug fixing.

Simply paste the code below into your functions.php file.

add_filter('template', 'default_ie');
add_filter('option_template', 'default_ie');
add_filter('option_stylesheet', 'default_ie');
function default_ie($theme) {
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false)
$theme = 'default';
return $theme;
}
About the Author: Devesh Sharma is a WordPress fanatic and loves experimenting with WordPress themes & plugins. Get more from Devesh on  and Twitter.

You May Also Like:

2 comments… add one
  1. This is very similar to http://www.nathanrice.net/blog/serve-ie6-visitors-the-default-wordpress-theme/ This one is simpler though.

Speak Your Mind...

A Weekly WordPress Newsletter...

Subscribe now and you will get -

»  Free Guide – Building a Successful WordPress Blog.
»  Weekly Newsletter curating useful blog posts and resources.
»  Exclusive Discount & Deals on Premium Products.

Your email will never be shared with anyone.