ThemeShaper Forums » Thematic

[closed]

force IE6 to only pick up ie6.css

(2 posts)
  • Started 9 years ago by JC
  • Latest reply from JC
  • This topic is resolved
  1. JC
    Member

    How do I force IE6 to pick-up ONLY the special ie6.css and NOT take into account style.css ?
    I have used :

    function childtheme_iefix() { ?>
        <!–[if IE 6]>
     <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/ie6.css" />
        <![endif]–>
    <?php }
    
    add_action('wp_head', 'childtheme_iefix');

    in my function.php but somehow It does not do the trick...

    What I really want is to have a totally different layout for people visiting with IE6.

    Posted 9 years ago #
  2. JC
    Member

    OK so after 6 hours that's what finally did it for me :

    1- Make a "blank" style.css in the child theme directory
    2- Put the styling for every browser except IE6 in mystyle.css (for example)
    3- Add this code to functions.php in child theme directory

    function childtheme_iefix() { ?>
    <!--[if !IE 6]><!-->
      <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/mystyle.css" />
    <!--<![endif]-->
    <!--[if gte IE 7]>
      <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/mystyle.css" />
    <![endif]-->
    
    <!--[if lte IE 6]><link rel="stylesheet" href="http://universal-ie6-css.googlecode.com/files/ie6.0.3.css" media="screen, projection"><![endif]-->
    <?php }

    Et voilà !
    Hope it helps somebody

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.