soundandshape
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Child Category IDs–So Close! please helpfound this and it seems to work!
Forum: Fixing WordPress
In reply to: Child Category IDs–So Close! please helpa 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.
http://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!
Forum: Fixing WordPress
In reply to: Retrieving ID from query_posts()I am also trying to figure out how to generate a list of IDs dynamically.
Instead of hardcoding the IDs into the page template, I need code that will dynamically return an array of the IDs of categories that are currently children of a certain parent category.
something like get_category_IDs(child_of=’ParentID’)?
If you figure this one out, please let me know!
c.