• I have this template we need to integrate to WordPress and we have a certain part which has a conditional IE stylesheet. When we first sliced the template and didn’t integrate it to WP the IE CSS was loading fine.

    The problem is that now for some reason the IE CSS doesn’t load and I have no clue why. This is the code I have placed on my header:

    <!--[if IE]>
    	<link href="<?php echo get_stylesheet_directory_uri(); ?>/iefix.css" rel="stylesheet" type="text/css" />
    <![endif]-->

    Is there anything wrong I am doing? You can also check the site online: https://tinyurl.com/39qvlx

Viewing 9 replies - 1 through 9 (of 9 total)
  • Does it work if you hard code it?

    example
    <!–Provides stylesheet to be used if browser is IE–>
    <!–[if IE]>
    <style type=”text/css” media=”screen”>
    @import url( https://yeleek.co.uk/wp-content/themes/yeleek/iestyle.css );
    </style>
    <![endif]–>

    <link href="<?php echo get_stylesheet_directory_uri(); ?>/iefix.css” rel=”stylesheet” type=”text/css” />

    This is wrong. Should be:

    <link href="<?php echo bloginfo('template_directory'); ?>/iefix.css" rel="stylesheet" type="text/css" />

    get_stylesheet_directory_uri(); – I don’t know where you got that from.

    Thread Starter subfusion

    (@subfusion)

    I tried both solutions and they don’t seem to work.

    Is there anything else that could be causing the problem? Check the URL above, it loads the code and the link to the IE fix is correct!

    I’m having trouble with this same issue on my site.

    In my header, I’ve added the following:

    <![if !IE 7]>
    <link href=”<?php echo bloginfo(‘template_directory’); ?>/ie7.css” rel=”stylesheet” type=”text/css” />
    <![endif]>

    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />

    In my template directory, I have two style sheets, the standard style.css stylesheet, and one named ie7.css. When I load my site in IE7, it doesn’t call the ie7.css stylesheet.

    However, if I remove the standard style sheet call (by that I mean this code: <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />), it does call the ie7.css style sheet.

    My site is here: https://idratherbewriting.com/simplx.

    @subfusion: I do not think you have this right. An IE conditional should go:

    <![if IE]>

    You seem to be confusing it with a comment with !– etc.

    Thread Starter subfusion

    (@subfusion)

    Updated, still doesn’t seem to work.

    Hi,

    Just looking – it seems that you are trying to fix the png issue. Just wondered if you set it to something else ie making text bold does it work then? i.e. is the issue the iecss not loading properly or is the issue in the png fix??

    For the png fix look at this – i’m using it in my header and no worries.
    PNG Fix

    Your formats are incorrect.

    <![if IE]>
    stuff here
    <![endif]>

    is incorrect.

    <!--[if IE]>
    stuff here
    <![endif]-->

    is how it should be.

    You should also place your IE stuff *after* ALL other stylesheets, to ensure that the IE stuff is overwriting what comes before it.

    And also, IE 7 also already supports the transparent PNGs, so it should be:

    <!–[if lte IE 6]>
    stuff here
    <![endif]–>

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘IE Conditional Stylesheets’ is closed to new replies.