Forums

IE Conditional Comment (3 posts)

  1. sustainfood
    Member
    Posted 1 month ago #

    I've customized the Kanata theme to add a RSS feed img and link into the header inline with the page tabs at the top of the site.

    Of course IE 7 and down have issue with this. I added this to my header.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <!--[if lte IE 7]>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/ie7.css" media="screen" type="text/css" />
    <![endif]-->

    This is all I have in the IE css

    #headerRSS {
    		position:absolute;
                    margin: -95 0 0 245;
                    width: 70px;
    		height: 70px;
    
    	}

    The strange thing is that it works when I remove the <!--[if lte IE 7]>, but does not work with it in... what's up?

  2. jonimueller
    Member
    Posted 1 month ago #

    Remove the first line and you should be okay; like this:

    <!--[if lte IE 7]>
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/ie7.css" media="screen" type="text/css" />
    <![endif]-->

    And I generally use and have been getting away with just this:

    <!--[if IE ]>

  3. sustainfood
    Member
    Posted 1 month ago #

    Thanks jonimueller you're right that it doesn't need to be in there, but that doesn't fix the problem. Do I need to call it before the standard css?

Reply

You must log in to post.

About this Topic