Showing specific categories
-
20-09-2019 - |
Question
I'd like to show only specific wordpress categories (with their sub-categories nested), so for example:
Main Category 1
- Sub Category 1.1
- Sub Category 1.2
Main Category 5
- Sub Category 2.1
- Sub Category 2.2
... I can hardcode it inside the sidebar template, but I'd like to know if there's any existing plugin/widget that allows this so I can easily manage category selection/update via admin panel.
Many thanks
Solution
You can accomplish this using the wp-list-categories tag. I'm assuming you're customising your template and this came up?
The function has enough parameters to customise it as you need.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow