post->ID; $categories = get_the_category($post_ID); foreach ($categories as $category) { $cat_id = $category->category_parent; if (empty($cat_id)) { $cat_id = $category->cat_ID; } } $current_id = $cat_id; /* -[ Blog ]- */ $subcats = 4; $categories = get_categories('child_of='.$subcats); $category_count = count ($categories); if ($category_count>0) { foreach ($categories as $cat) { $var = $cat->cat_ID; if ($current_id == $var || $current_id == $subcats) { $incat = "incat_blog"; } } } /* -[ Resources ]- */ if ($current_id == 23) { $incat = "incat_resource"; } include (TEMPLATEPATH . '/tpl.global.php'); ?>