If category is in parent category?

If i understand right your “post_is_in_descendant_category” function checks if a post is descendant of a category and you want to check if a category is descentand. If so the add this function to your functions.php

function is_desc_cat($cats, $_post = null) {
  foreach ((array)$cats as $cat) {
    if (in_category($cat, $_post)) {
      return true;
    } else {
      if (!is_int($cat)) $cat = get_cat_ID($cat);
      $descendants = get_term_children($cat, 'category');
      if ($descendants && in_category($descendants, $_post)) return true;
    }
  }

return false;
}

and use it like this:

if (is_desc_cat("foo")) {
  // use foo.css
} else {
  // use default.css
}

Hope this helps.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)