<font color="#333333"><font><font face="arial,helvetica,sans-serif">That's why we have Modernizr for. Loading IE stuff separately is ancient history.</font></font></font><div><font color="#333333" face="arial, helvetica, sans-serif"><br>
</font></div><div><font color="#333333" face="arial, helvetica, sans-serif">Example:</font></div><div><font color="#333333" face="arial, helvetica, sans-serif"><br></font></div><div><pre style="word-wrap:break-word;white-space:pre-wrap">
<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head></pre></div><div><font color="#333333" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#333333" face="arial, helvetica, sans-serif">and if I need to change something for IE7 same stylesheet will be used</font></div>
<div><font color="#333333" face="arial, helvetica, sans-serif"><br></font></div><div><pre style="word-wrap:break-word;white-space:pre-wrap">.ie7 #my-header {}</pre><div><font color="#333333"><font><font face="arial,helvetica,sans-serif"><br>
</font></font></font></div><div><font color="#333333"><font><font face="arial,helvetica,sans-serif">Thanks,</font></font></font></div><div><font color="#333333"><font><font face="arial,helvetica,sans-serif">Emil<br></font></font></font><br>
<div class="gmail_quote">On Wed, May 16, 2012 at 11:54 AM, Sayontan Sinha <span dir="ltr"><<a href="mailto:sayontan@gmail.com" target="_blank">sayontan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There is an issue with the approach suggested by Konstantin. It doesn't handle negative conditionals. See <a href="http://core.trac.wordpress.org/ticket/16118" target="_blank">http://core.trac.wordpress.org/ticket/16118</a>. If you need to support negative conditionals you will either require the patches in the Trac ticket or use the approach that I have suggested.<div class="HOEnZb">
<div class="h5"><br>
<br><div class="gmail_quote">On Wed, May 16, 2012 at 9:50 AM, Chip Bennett <span dir="ltr"><<a href="mailto:chip@chipbennett.net" target="_blank">chip@chipbennett.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What Konstantin said. I recommend this method as best practice.<br>
<br>
Chip<br>
<div><div><br>
On 5/16/12, Konstantin Obenland <<a href="mailto:konstantin@obenland.it" target="_blank">konstantin@obenland.it</a>> wrote:<br>
> How about:<br>
><br>
> function prefix_enqueue_scripts() {<br>
> wp_enqueue_style( 'handle', get_template_directory_uri() . '/ie.css',<br>
> array('style') );<br>
><br>
> global $wp_styles;<br>
> $wp_styles->add_data( 'handle', 'conditional', 'lt IE 9' );<br>
> }<br>
> add_action( 'wp_enqueue_scripts', 'prefix_enqueue_scripts' );<br>
><br>
> Konstantin<br>
><br>
><br>
> On 16.05.2012, at 17:18, Sayontan Sinha wrote:<br>
><br>
>> Actually you can use wp_enqueue_style for this, by combining with the<br>
>> style_loader_tag filter. E.g.:<br>
>><br>
>> add_filter('style_loader_tag', 'suffusion_filter_rounded_corners_css', 10,<br>
>> 2);<br>
>> function suffusion_filter_rounded_corners_css($css_html_tag, $handle) {<br>
>> if ($handle == 'suffusion-rounded') {<br>
>> return "<!--[if !IE]>-->".$css_html_tag."<!--<![endif]-->\n<!--[if<br>
>> gt IE 8]>".$css_html_tag."<![endif]-->\n";<br>
>> }<br>
>> return $css_html_tag;<br>
>> }<br>
>><br>
>><br>
>> On Wed, May 16, 2012 at 8:14 AM, .: chris :. <<a href="mailto:chris@jazzsequence.com" target="_blank">chris@jazzsequence.com</a>><br>
>> wrote:<br>
>> Why not use conditional classes instead of conditional stylesheets?<br>
>> <a href="http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/" target="_blank">http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/</a><br>
>><br>
>> :: code bandit ::<br>
>> <a href="http://protocol.by/jazzsequence" target="_blank">http://protocol.by/jazzsequence</a><br>
>> <a href="http://about.me/jazzs3quence" target="_blank">http://about.me/jazzs3quence</a><br>
>><br>
>> On May 16, 2012, at 9:11 AM, Shinra Web Holdings wrote:<br>
>><br>
>>> Are themes still permitted to load browser-conditional style sheets using<br>
>>> <!--[if IE 7]><link rel="stylesheet" href="ie7.css" type="text/css"<br>
>>> media="screen" /><![endif]--> or are they required to discover the<br>
>>> browser using PHP and use wp_enqueue_style() ?<br>
>>> _______________________________________________<br>
>>> theme-reviewers mailing list<br>
>>> <a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> theme-reviewers mailing list<br>
>> <a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Sayontan Sinha<br>
>> <a href="http://mynethome.net" target="_blank">http://mynethome.net</a> | <a href="http://mynethome.net/blog" target="_blank">http://mynethome.net/blog</a><br>
>> --<br>
>> Beating Australia in Cricket is like killing a celebrity. The death gets<br>
>> more coverage than the crime.<br>
>><br>
>> _______________________________________________<br>
>> theme-reviewers mailing list<br>
>> <a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
><br>
><br>
<br>
</div></div><span><font color="#888888">--<br>
Sent from my mobile device<br>
</font></span><div><div>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Sayontan Sinha<br><a href="http://mynethome.net" target="_blank">http://mynethome.net</a> | <a href="http://mynethome.net/blog" target="_blank">http://mynethome.net/blog</a><br>
--<br>Beating Australia in Cricket is like killing a celebrity. The death gets more coverage than the crime.<br><br>
</div></div><br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br></div></div>