WordPress Categories: Tree View / Inheritance

If you work with hierarchical categories (taxonomies) in WordPress, you will notice that, on the one hand, the display of the checked categories in the backend is confusing and, on the other hand, posts do not automatically end up in the parent category if they are placed in the child category. Both can be straightened out with just a few lines of code using the powerful hook system (in the form of an action and a filter).


85b430a0acae9cf5c958

WordPress Categories: Tree View Inheritance Display without category selection (WordPress standard)

WordPress Categories: Tree View Inheritance Display according to category selection (WordPress standard)

WordPress Categories: Tree View Inheritance After the code adjustment, the parent category (manufacturer) is set and the tree representation is retained

Back