Free Signup |
Login

Not a member? Join for free.

Add Internet Explorer Stylesheets to Thesis

by Adam Barber on March 24, 2010

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.

Still Have Questions?

Great! Get in touch with me and I'll help you out. In addition to writing tutorials and developing some of the most widely used Thesis Skins, I'm also available for hire.

Leave a Comment

Previous post:

Next post: