a quick search of this forum reveals that others are trying to figure this one out, but with no resolution! can anyone help?
I think I’m close– I just don’t know how to use the cat_is_ancestor_of(cat1, cat2) function properly. any tips?
So far I’ve been fiddling around with something like this
$category_ids = get_all_category_ids(); //puts array of category IDs into variable $category_ids
foreach ($category_ids as $category) { //loop thru the array…
if (cat_is_ancestor_of($category, 5)) { //determine which category IDs are children of category 5.
[do some code;] // only if $category is a child of ID5
}
}
this doesn’t work, but it illustrates what I’m trying to do. I’m hoping I just need the correct syntax. how do I write this properly?
btw, I found this from Otto.
https://www.tibbles.net/designs/?p=25
It seems like it’s along the same lines. Does it spark any ideas from anyone?
any help would be appreciated!