Conditional CSS in function.php
-
Hey everyone –
I am having a wee issue with referencing a conditional style sheet for IE.
I’ve named the stylesheet “ie6.css” and want to add it to function.php, but every code I have tried does not work.
Here is an example of one of the options I had been trying:
function ie6_css() { ?> <!--[if lt IE 6]> <link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/ie6.css" /> <![endif]--> <?php }
I have placed ie6.css in the theme’s root directory where the default css resides, and have changed some style info to test if it is actually being picked up by IE 6 and so far, have had no luck. I am fairly certain the issue is in the above code – and likely something I’ve messed up or neglected. I wasn’t sure what to put after the function statement, so I put “ie6_css” – not sure if that’s the main problem or not.
Anyway, does anyone have an suggestions on which code to add to my function.php file to get IE to play nice? I really want to target all versions of IE prior to IE8 – the site seems fine in IE8, its just IE 6 & 7 that are the issues.
Thank you!
~Deirdre
- The topic ‘Conditional CSS in function.php’ is closed to new replies.