*CLARIFICATION: I'm trying to style the single post view of some categories & sub categories. The suggested solution works, but only on a page of posts from the selected categories.
Eg. If a post has a category 0f 59 (or is a child category of 59) then load a stylesheet.
Here's what I've tried from the Codex-
<?php // if the category is 59 or a 59 SUBcategory if (cat_is_ancestor_of(59, $cat) or in_category(59)): ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/products.css" type="text/css" media="screen" /><?php endif; ?>
Any ideas why it's not working? Thanks