Check whether a post is under a category?
-
Is there a conditional function to check whether a post is *under* a certain category, even if it wasn’t exactly assigned to the category (eg, I have a ‘News’ category, I check the ‘Music’ subcategory under that, now in_category($newsid) returns false).
Or do we need to use get_the_category and do a for loop through each category and a while loop all the way up its parents and parents’ parents?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Check whether a post is under a category?’ is closed to new replies.