Cannot display hierarchical categories list of all blog's categories (including children)
|Reported by:||kwa1975||Owned by:|
When trying to display a hierarchical categories list including children, one could write the following PHP line in his/her theme:
Since the parent category of all the other categories is 0, we had to set child_of to zero.
However, it appears the wp_list_cats() function uses the value 0 of child_of as both an integer value to limit the categories display to a given parent category (here, we want to limit it to category 0) AND as a boolean value, meaning 0 means "false" and the children of category 0 won't be displayed.
To fix this issue, another parameter should be added or a different value for child_of should be used.
Change History (3)
comment:1 @masquerade — 10 years ago
- Keywords changed from template,theme,category,categories,hierarchical,parent,child,children,child_of,list,display to template theme category categories hierarchical parent child children child_of list display