ThemeShaper Forums » Thematic

[closed]

Referencing ie7.css stylesheet located in child theme

(10 posts)
  • Started 4 years ago by napalm
  • Latest reply from licoricefrog
  • This topic is resolved
  1. Hi Guys,
    Can anyone tell me if theres a hook that will direct me to the child theme ?

    I was hoping I could create a link to a stylesheet located in my child themes folder using something like :

    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/ie7.css" media="screen" />

    Obviously the above links me to my main template (Thematic), but is there a way using a hook to locate the child theme folder ? I understand this url can be hard coded, but just interested in doing it this way if possible.

    Posted 4 years ago #
  2. BAM! get_bloginfo('stylesheet_directory')

    Posted 4 years ago #
  3. Hi there,

    Looking for some help/suggestions if possible :)

    I've created an IE7 style sheet for the website http://www.financialplanningexpert.com.au to fix a couple of positional bugs in the header (have a logo, widget and search bar that's giving me grief). I've added a function to functions.php that references the IE7 style sheet located in my child theme's 'style' folder. Here's the function code:


    <?php //add ie7 style sheet
    function childtheme_ie_style() { ?>
    <!--[if lte IE 7]>
    <link rel="stylesheet" type="text/css" src="<?php echo get_bloginfo('stylesheet_directory'); ?>/style/ie7style.css" />
    <![endif]-->
    <?php }
    add_action('wp_head', 'childtheme_ie_style');
    ?>

    The issue is that despite my efforts, the IE7 style sheet doesn't seem to be doing anything and doesn't appear to be picked up. I've tried removing some obvious elements (such as the logo) from the IE7 stylesheet to see if it's working but no luck.

    Using Adobe Browser Labs atm to test. I hope this makes sense. Any feedback would be great!

    Cheers.

    Posted 2 years ago #
  4. I looked at this earlier, the code snippet to add the ie7 style sheet looks fine, it should be working.

    One thing I noticed is that you have the whole style sheet loading again in the ie7styles.css, that isn't how it is intended to work. Instead remove everything from the file and add only the changes required to make it behave.

    To easily test, remove everything from the ie7 style sheet and just put,

    body { background: #ccc; }

    I have a feeling you just deleted code out of the file to test it but it was still reading the original CSS file, hence no visible changes. Pretty sure this could be fixed without a IE7 style sheet by tinkering with the CSS.

    Posted 2 years ago #
  5. Thanks Scott. Yep, you're right. I just removed a few attributes from each element in the IE7 style sheet when I should have actually changed the attribute in each element to initiate the change.

    I've been tinkering and have fixed pretty much all of it through CSS (thanks for the tip... I just got a little lazy I guess... damn IE.) I just have a problem with my search bar. I've had to position it absolutely so that it will sit flush with the #access div. If I use relative positioning with it, I'm left with a huge ugly gap between the #header and the #main divs. Very strange as there is no margin/padding pushing the #main div down, nor is there a height element in the #header div.

    The only element I have in the IE7 style sheet now is:

    #search-aside {position:relative;}

    but the sheet still appears to not be working. Am I doing something wrong?

    Really appreciate your help, thanks again.

    Posted 2 years ago #
  6. Damn. Hit the post button twice. Ah it's too hot today.

    Posted 2 years ago #
  7. Ok, without using the IE7 stylesheet, try this.

    Add To the #access css.

    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;

    Add to the #header css a fixed height. I think it might make your life a little easier for positioning the elements inside it.

    height:190px;

    That may get you a little closer, won't be prefect, but I figured out how to finally edit CSS rules in IE Dev Tools, but oh man the usability of it is crap compared to Firebug.

    Posted 2 years ago #
  8. WOW! That worked!! Seriously, I can't thank you enough for your help. The look is pretty much perfect now (except for the rounded corners), but I'm not too fussed about that because of the early IE lack of rounded corners support, plus, users should just be updating their browsers!!

    I haven't experienced using IE Dev Tools yet, but Firebug is just a lifesaver - don't know what I'd do without it.

    Anyway, thanks again, just so nice to have someone out there care just enough to sort out my shitty little problem.

    Cheers :)

    Posted 2 years ago #
  9. users SHOULD update their browsers. i try to avoid fixing stuff for IE7 if i can. when dealing w/ IE7 i don't ask myself "does this look awesome?", I ask "is this passable?" i'm aware that some corporations still use IE7, but well... i've already lost too many hours to that POS.

    i also like this idea and plan to implement it into the portfolio site that i've been working on for you know... a year or more

    http://jonikorpi.com/leaving-old-IE-behind/

    Posted 2 years ago #
  10. Yeah I totally agree. Passable is the key.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.