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 { … Read more