[WordPress] IE6 の時だけテーマを変更

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;
}

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.

This following snippet is added to functions.php so remember to backup first.
via Forcing A Different Theme For IE6 Users | WPZine


Posted

in

by

Comments

コメントを残す