Get "true" if I ask for a parent category of a post
-
Is there an easy way to know if a post is under a parent category, no matter the child ones?
Example:
If my categories are:
CAT 1
└-CAT 1.1
└-CAT 1.2
..└-CAT 1.2.1
..└-CAT 1.2.2
….└-CAT 1.2.2.1
….└-CAT 1.2.2.2
CAT 2
└-CAT 2.1
..└-CAT 2.1.1
..└-CAT 2.1.1
└-CAT 2.2If a post is under “CAT 1.2.2.2” or “CAT 1” or “CAT 1.1” I want to get “True” if I ask if is in category “CAT 1”.
Thanks in advance.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Get "true" if I ask for a parent category of a post’ is closed to new replies.