Need A Design To WOW Your Visitors?

Open

Add Internet Explorer Stylesheets to Thesis

by

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.

Adam is the founder and lead developer at ThesisReady.com. I’ve been designing websites and doing graphic design work since the 8th grade. I’ve spent the majority of my adult (read: post-college) life working full-time on Thesis projects and running ThesisReady.com.

Are You A Member Yet?

Become a member of ThesisReady.com for free. It only takes a second to join and you get unlimited access to tons of great content including...

  • Free Thesis Skins
  • Special Offers and Discounts
  • Early Access to New Content
  • Much, much more...
Adam Barber has written 93 posts for ThesisReady.com

{ 3 comments… read them below or add one }

Anthony

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!!

Reply

Matty

Great post – just was I was looking for.

Reply

Melly

It’s always a relief when someone with obvious expertise answers. Thanks!

Reply

Leave a Comment

Previous post:

Next post: