Need children category names to appear on parent category page
-
This is ridiculous… I’ve spent hours on what should be a simple task, and looking around the web and at the codex, I’m not the only one.
Here’s the scenario…
The parent category has an id of 2. When they go to that parent category (let’s call it “beer”), I want all the subcategory names to display at the top, with links to those subcategories. In short, I want to provide shortcuts, if people are only interested in “miller” or “molson” and don’t want to read all of “beer”.Now, having the cats display in only one category is as easy as
'if (cat == "2") {'
Now, the obvious choice would be list_cats(), but I don’t want all cats, only the children of 2. So, lets go with
'list_cats('child_of=2');'
Nope.
How ’bout:
'list_cats('child_of=2&categories=2');'
Nope.
Exclude is no good to me, because there’s already a lot of categories and as soon as the client adds a new one (and they will), it will break.
There is no include, to limit to only one category.
So does anyone have any ideas? Please?
- The topic ‘Need children category names to appear on parent category page’ is closed to new replies.