WordPress Category Parents
Posted September 9th, 2007 @ 01:48pm by Erik J. Barzeski
Imagine I have a blog which has nested categories. Category "C" is a child of category "B," which is itself a child of category "A." I can draw this up as A > B > C > D
.
I'd like to get the category ID for the original parent ("A" in this case), yet WordPress doesn't have any built-in functionality to do this.
Any ideas? Everything I've come up with has been (seemingly) too complex to be the correct and/or "best" solution.
There exists a function cat_is_ancestor_of
in "category.php," but it doesn't seem to work.