Support » Fixing WordPress » How to call Page specific IE6 stylesheet?

  • I’ve got a couple of different stylesheets calling for page and category designs (see below). Is there a way to call an IE specific stylesheet for each? For example, calling (is_page) for the IE6 specific stylesheet which differs from the (is_category)? Otherwise I can’t just use an [if IE 6] call that blankets the site. (oh, sweet death to IE6…)

    —–
    [code]<?php if (is_page()) { ?>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style2.css" type="text/css" media="screen" />
    <?php } else if (is_category()) { ?>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style2.css" type="text/css" media="screen" />
    <?php } else if (is_single()) { ?>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style2.css" type="text/css" media="screen" />
    <?php } else { ?>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.css" type="text/css" media="screen" />
    <?php } ?>[/code]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Check out the get_browser() function in php (http://us.php.net/function.get-browser).

    That can cause a performance hit, though, and if you’re using the super cache plugin, it won’t work anyway. You’re probably better off using the CSS conditionals.

    Thread Starter misterwendellcat

    (@misterwendellcat)

    Thanks sojweb… Not sure if that’s exactly what I’m looking for. Surely there must be a PHP call something to this effect out there?
    <?php } else if (is_IE6)(is_single()) { ?> …etc.?

    That function can give you detailed version information about the browser. There’s also a quick and dirty method, like this:

    function is_IE() {
    $pos = strpos($_SERVER['HTTP_USER_AGENT'],' MSIE ');
    if($pos!==FALSE) return TRUE;
    return FALSE;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to call Page specific IE6 stylesheet?’ is closed to new replies.