• Hi everyone
    I know this has been a topic for a while but it′s driving me mad and I just can′t figure what I′m doing wrong..
    All I want to do is to change the css if the category changes. I′m using Mapleleaf theme and after reserarch i′ve come to the conclussion that the best way to do this is with a conditional tag on header.php.
    This is the code:

    <style type=”text/css” media=”screen”>
    @import url(<?php bloginfo(‘stylesheet_url’);?>);
    @import url(‘category-8.css’);
    </style>

    <link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″

    href=”<?php bloginfo(‘rss2_url’); ?>” />

    <?php if(is_category(‘8’)){ ?>
    <link href=”https://myblog.com/category-8.css&#8221; type=text/css rel=stylesheet>
    <?php } else { ?>
    <link href=”https://myblog.com/style.css&#8221; type=text/css rel=stylesheet>
    <?php } ?>

    (it goes on but this is the bit we need)
    I′m just trying with one category at the moment. Of course I′ve uploaded category-8.css in the mapleleaf theme folder. The result is none: it displays the default style.css even if we click on category-8.
    Can someone figure out what′s happenning? Am I missing something?

    Thanks a lot.

  • The topic ‘changing css in categorys(again)’ is closed to new replies.