In some cases you may need to group your tag groups under a parent level. Having a 2-level hierarchy can make it easier to select a cluster of child groups by referring to their parent. It also helps your authors understand, which groups belong together.
Parent groups can only hold (default) tag groups, but no tags. That means that we can have only a maximum of two group levels – parent groups and their child groups – and then the tags inside the child groups.
parent group: cars group: color tags: red, blue, green, ... group: configuration tags: air con, 4x4, autopilot, ... parent group: bicycles group: color tags: red, blue, green ... group: manufacturer tags: company A, company B, ...
Parent groups don’t appear in frontend post filters (Toggle Post Filter, Dynamic Post Filter) and they have no effect on their logic operations.
Tag Group Administration
On the Tag Group Administration screen you find a text field where you can add a parent group by entering the name.
Just like default groups, you change the order of parent groups by drag and drop or by clicking on the up or down arrow at the end of the row. All default groups that are below a parent group are its children. You can also edit the name or delete a parent group.
It is also possible to use tag groups without a parent level.
Note: If you are using parent groups, all groups can have duplicate names. It is still recommended to avoid duplicates, however, because at some places you might confuse groups with identical names.
Tag and Post Filters
Once you’ve created parent groups, you will find them in the drop-down menus above the lists of tags and posts. If you select a parent group, all of its children will automatically be included in the filtering criteria.
Note: Styling of parent groups in menus depends on browser capabilities.
Tag Clouds and Lists
Parent groups are not visible on your public web site1 but they make your work easier on the back end. You can, for example, include or exclude all children by referring to their parent group. If you use shortcodes, you simply insert the parent group’s ID, exactly how you would use the list of group IDs.
Post Tags (under Posts)
In the Tag Group settings, under Front End > Post Tags, you find an option that lets you show also parent groups in the tags below the post content. Parent groups, default groups and tags are displayed in a table. The precise appearance depends on how your theme displays tables.
Tag Meta Box (on the Post Edit Screen)
Also the Tag Meta Box on the post edit screen shows your groups sorted under parent groups. This upper level acts only as a visual guidance that helps you organize your groups but it doesn’t change the way how we handle tags.
- With the exception of post tags, see the next chapter.