The bane of the Internet continues to be Internet Explorer. About a billion and one articles have been written about dealing with the problems that it creates and specific CSS level corrections to accommodate the weirdness, so I won’t discuss any of those. Instead, here’s a quick tip for adding a new IE only stylesheet to your Thesis blog. This is usually the last step I take when I’m done working on a Thesis Skin.
The Code
function ie_stylesheet() { ?>
<!--[if IE]>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory') ?>/custom/ie.css" type="text/css" media="screen" />
<![endif]-->
<?php }
add_action('wp_head', 'ie_stylesheet');
The code above will add a new stylesheet in of your blog when you add it to your custom_functions.php file. One note – make sure this is the last hook added to ‘wp_head’ to avoid css conflicts.





{ 3 comments… read them below or add one }
Hi Adam,
Thanks for this tip. I am trying to postion some icons in a header widget next to my logo on my blog and although I have accomplished this in Firefox, IE is way off the mark. Once I add this code to my custom_functions.php where does the CSS go to position it? I have been using margin-top to position it in Firefox, would this be the same for IE?
Apologies I’m a novice in this area
Thanks!!
Great post – just was I was looking for.
It’s always a relief when someone with obvious expertise answers. Thanks!