Ok, i would like to have, differen CSS for post titles for each different category.
For example.
All posts from category a coloured red
All posts from category b coloured green

Here are some codes i have tryed and people are sayign that they are working but why dont they work for me?
My post titles defautl colour is fetched from post.css and not basic.css

The codes i tryed:

Code: 
  1. get the cat id nr. like "194" for w33d on www.something.kom
  2. <h2 id="color_<?php foreach((get_the_category()) as $category) { echo $category->cat_ID . '';} ?>">blaaaaaaaaaablaaaaaaaaaaaaablaaaaaaaaaaaa</h2>
  3. CSS file like
  4. #color_194 a {
  5. color:#99FF00;
  6. }
This one

Code: 
open file -> index.php

past code under
<div class="post-header">
------------------------------------------------------------------------------
<h2 id="color_<?php foreach((get_the_category()) as $category) {
    echo $category->cat_ID . '';
} ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>

------------------------------------------------------------------------------

go to your theme folder => stylesheets folder
open file -> basic.css
XXXXXXXXXXXX = your cat ID
------------------------------------------------------------------------------
.post-header #color_XXXXXXXXXXXX a {
    color:#FFFF00;
    text-decoration: none;
    font-family: Verdana;
    font-size: 11px;
}
.post-header #color_XXXXXXXXXXXX a:hover {
    text-decoration: underline;
    border: none;
    color:#FFFF00;
}
.post-header #color_XXXXXXXXXXXX a:visited {
    border-bottom: 1px dotted;
    text-decoration: none;
}
And this one

Code: 
  1. Post that code in your <head>......</head>
  2. Different CSS For Categories
  3. For having different CSS for the categories use the following code :-
  4. <?php if( is_category( 1 ) ) { ?>
  5. <link rel=?stylesheet? href=?URL of style1.css? type=?text/css? media=?screen? />
  6. <?php } elseif ( is_category (2) ) { ?>
  7. <link rel=?stylesheet? href=?URL of style2.css? type=?text/css? media=?screen? />
  8. <?php } elseif ( is_category (3) ) { ?>
  9. <link rel=?stylesheet? href=?URL of style2.css? type=?text/css? media=?screen? />
  10. <?php } else { ?>
  11. <link rel=?stylesheet? href=?URL of style.css? type=?text/css? media=?screen,projection? />
  12. <?php } ?>
  13. Here 1,2&3 represents Category ID?s and style1.css, style2.css & style3.css represents their different CSS repectively.
  14. http://www.dailytechpost.com/index.php/different-css-styles-for-different-pages-and-categories-in-wordpress/
r00ts Reviewed by r00ts on . Different css for different category. Ok, i would like to have, differen CSS for post titles for each different category. For example. All posts from category a coloured red All posts from category b coloured green Here are some codes i have tryed and people are sayign that they are working but why dont they work for me? My post titles defautl colour is fetched from post.css and not basic.css The codes i tryed: Rating: 5