WordPress.org

Ready to get started?Download WordPress

Forums

Default Template not linking to Stylesheet in IE 7 or 8? (9 posts)

  1. LukeSlyTalker
    Member
    Posted 4 years ago #

    I'm just about done with my site, but am running into an IE compatibility issue. I know shocker right. No problems in Firefox, Opera, Safari or Chrome. Ugg...sigh.

    Anyways it appears that in IE 7 and 8 my site is not pulling my stylesheet at all. It was working before when I was developing on my subdomain, but I've since added some conditional code depending on what page you're on. See below.

    <?php if( comments_open() ) :?>
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/blog.css" media="screen" type="text/css" />
    <?php elseif ( is_page_template('homepage-page-template.php')  ) :?>
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/home.css" media="screen" type="text/css" />
    <?php elseif ( is_page() ) :?>
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style.css" media="screen" type="text/css" />
    <?php endif;?>

    This pulls different stylesheets depending on what page you're on. That being said I think that might be my issue. I jsut don't know how to fix it. Any ideas?

  2. LukeSlyTalker
    Member
    Posted 4 years ago #

    Sorry here's the link to the site in question -->
    http://www.antimicrobial.com

  3. LukeSlyTalker
    Member
    Posted 4 years ago #

    I also added this strip of code for all versions of IE. It's supposed to automatically pull your css which was working before, but I figured due to the multiple calls to diff stylesheets I'd give this a shot.

    It's an absolute target as I was starting to run out of ideas as to why IE couldn't find it.

    <!--[if IE]>
    	<link rel="stylesheet" type="text/css" href="http://antimicrobial.com/wp-content/themes/default/style.css" />
    <![endif]-->
  4. Mark / t31os
    Moderator
    Posted 4 years ago #

    Try moving the colon away from the closing PHP tag in your conditional statements and see if that helps..

    Replacing this..

    :?>

    With..

    : ?>
  5. LukeSlyTalker
    Member
    Posted 4 years ago #

    Hello t31os_,

    I gave that a shot. It didn't seem to do anything.

  6. Mark / t31os
    Moderator
    Posted 4 years ago #

    Ok, so what happened when adding the IE conditional statement above?

  7. LukeSlyTalker
    Member
    Posted 4 years ago #

    It didn't seem to do anything. This strip of code commented out is supposed to pull what ever css you link it to.

  8. esmi
    Forum Moderator
    Posted 4 years ago #

    If this code is being added to header.php, I'm not sure if <?php if( comments_open() ) :?> will work as it's outside the Loop.

    Also you have errors in your IE only stylesheet - something that has been known to bring IE's CSS parsing to a shuddering halt.

  9. LukeSlyTalker
    Member
    Posted 4 years ago #

    If this code is being added to header.php, I'm not sure if <?php if( comments_open() ) :?> will work as it's outside the Loop.

    I'm not sure I understand what you're saying here?

    I suppose I could add a different conditional statement to the stylesheet. That one right there says that if this is a blog post page where comments are open pull the following stylesheet.

    The stylesheet in question is the same one that IE was working with before I moved the site from the subdomain. I'm sure there are some issues with it, but before I can tackle any formatting problems I need to first get the site to actually pull the stylesheet.

Topic Closed

This topic has been closed to new replies.

About this Topic