pixelgeek
Member
Posted 4 years ago #
I have a blog that aggregates news and I am looking at including a new category for the company each news item is about.
This will involve about 50 - 60 company categories and in order to keep my category listing managable I wanted to organize them in a main "Companies" category and then exclude the Companies category.
Problem is that wp_list_categories will only exclude a parent but will still display the child categories (which seems nonsensical...)
Is there a way to exclude the child categories of a parent or do I need to rewrite wp_list_categories?
BTW, I have close to 40 categories that I am displaying so writing an include param is not an option.
TIA
pixelgeek
Member
Posted 4 years ago #
Just to add. I did try using unfold_list_categories but it doesn't actually appear to do what I want either.
pixelgeek
Member
Posted 4 years ago #
It might be a start. Thanks
Sadly I have parent and child categories I do want to display so I'd need to do some additional coding.
Or resort to using the include=x,y,x parameter for template tag, wp_list_categories().
Rewring wp_list_categories would be LAST on my list. No make that NEVER on my list ;)
pixelgeek
Member
Posted 4 years ago #
I'm not going to do that. Its too much of a pain in the *ss and I can't see how it would not be a resource hog of a query to run repeatedly. This sits on the front page and gets called thousands of times a day.
I have to say that it strikes me as slightly... well dumb that child categories of a parent show up.
Yet another oddity around the category code.
I'll have to find some other solution.
Thanks