WordPress.org

Ready to get started?Download WordPress

Forums

How to call Page specific IE6 stylesheet? (4 posts)

  1. misterwendellcat
    Member
    Posted 5 years ago #

    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]

  2. sojweb
    Member
    Posted 5 years ago #

    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.

  3. misterwendellcat
    Member
    Posted 5 years ago #

    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.?

  4. sojweb
    Member
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags