• Sorry for the lame title πŸ˜€

    I have finally managed to set up my own theme @ http://dusk.our-cross.net. I was browsing around, searching for a way to use a different stylesheet for a single post in a given category. I think I have found the solution to my problem in the WordPress Codex:

    Different CSS For Different Categories

    Many users want to create separate CSS files for a specific category. This, too, can be easily accomplished. It is important to remember that stylesheets are defined and loaded in the <head> section of the HTML document. WordPress uses the header.php file for this. In the default header.php, find this line:

    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />

    And change it to something like this:

    <?php if ( is_category(‘5’) ) { // Load special CSS for “Cars” category ?>
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_url’); ?>/category-5.css” type=”text/css” media=”screen” />;
    <?php } else { ?>
    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />
    <?php } ?>

    Thing is, Underscores does not seem to recall the stylesheet this way. I know I must sound dumb, but… what do I do now?

The topic ‘how does Underscores call the CSS’ is closed to new replies.