• Resolved Luk Gaming

    (@luk-gaming)


    Unfortunately my custom wordpress theme isn’t completely IE friendly and it requires some position changing and font changing etc.

    Anyway, I thought the easiest way to do this is to use a seperate IE-only css and use conditional comments to make IE browsers load the separate css sheet.

    However for some reason my IE9 isn’t reading the conditional comment and is just loading the normal style.css sheet.

    Unfortunately I’m working on this from a local server, but I can paste the relevant piece of code that I’m using in the header here.

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="main">
     *
     *
     */
    ?>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 * We filter the output of wp_title() a bit -- see
    	 * twentyten_filter_wp_title() in functions.php.
    	 */
    	wp_title( '|', true, 'right' );
    
    	?></title>
    <link rel="profile" href="https://gmpg.org/xfn/11" />
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <!--[if IE]>
    <link rel='stylesheet' type='text/css' href='ie.css' />
    <![endif]-->
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />

    I’ve not a clue what’s wrong. I’ve looked high and low on google to no avail.

    Any help would be great thanks!

    EDIT: Resolved this myself, you must have the full complete url of the css for it to work.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘IE conditional comment not working’ is closed to new replies.