Forums

[resolved] Using alternate stylesheets for IE (3 posts)

  1. creativelifeform
    Member
    Posted 2 years ago #

    Hi all,

    I use the method described on this site to have different stylesheets for the various IEs. I'm just wondering if this can work with a WordPress install?

    Currently I'm trying this but it ain't workin

    <!--IE sucks-->
    <!--[if gte IE 8]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/ie-8.css" />
    <![endif]-->
    <!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/ie-6.css" />
    <![endif]-->
    <!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/ie-7.css" />
    <![endif]-->

    Any ideas?

  2. JLeuze
    Member
    Posted 2 years ago #

    Sure, this works just fine with WordPress themes. But the template tag that you are using can be problematic as the link is relative to your main stylesheet's location.

    You should have better luck using the template_url tag which covers the entire theme, not just the main stylesheet:

    <?php bloginfo('template_url'); ?>
  3. creativelifeform
    Member
    Posted 2 years ago #

    Hi, thanks jleuze, I didn't change anything and its working now. Stupid IETab for Chrome...I don't think its so accurate...when I test in IE8 its fine, but if I test in IETab...no go.

    Noted about template_url, I usually put my css directory where the main style.css is located anyway but that's good to know. Cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic