[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

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト /  変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト /  変更 )

%s と連携中

%d人のブロガーが「いいね」をつけました。