Custom Taxonomies
2 min read Updated
A taxonomy groups posts. The groups in a taxonomy are called terms. WordPress posts have two taxonomies: Categories and Tags. With the Custom Post Type Builder, you can add taxonomies to each post type you build. For example, Northfield Studio adds a Project Types taxonomy to its Projects post type, with the terms Website, Branding and E-commerce.
Add a Taxonomy
- Go to ToolsAll Post Types and edit the post type.
- In the Post Type Settings box, go to Taxonomies and click Add.
- Enter the settings below.
- Click Update.
Click a taxonomy to open it. Use the icons on the right of a taxonomy to duplicate or delete it.
Label
The name of the taxonomy in the admin menu and on its screens, for example Project Types.
Slug
The name WordPress uses for the taxonomy, and the start of its URLs, for example /project-type/branding/. A taxonomy without a slug is not added. Use lowercase letters, numbers, hyphens and underscores. WordPress accepts up to 32 characters, and the addon doesn’t check this, so a longer slug doesn’t work. To use a taxonomy that already exists, enter its slug, for example category for the WordPress categories. The post type then shares that taxonomy, and the other settings here are not used.
Hierarchical
Taxonomies are tags by default. Hierarchical taxonomies are categories: a term can have a parent term, and editors choose terms from a list of checkboxes. Default: off.
Display taxonomy column
Shows the terms of each post in a column on the admin posts list. Default: off.
Managing Terms
After you update the post type, each taxonomy shows under the post type in the admin menu. For example, go to ProjectsProject Types to add, edit and delete terms. The screen works like PostsCategories and PostsTags. At the moment, some text on it still says Tag or Category, for example Add Tag.
To add terms to a post, use the taxonomy box in the sidebar of the post editor. See Adding New Posts.
Show the Terms on Each Post
To show the terms of a post on the post itself, add a SiteOrigin Taxonomy widget to the post type layout. In Taxonomies, choose your taxonomy, for example Project Types. The widget shows the terms of each post, so you can make it Read Only.
Each term also has an archive page that lists its posts, for example /project-type/branding/. You can add these pages to a menu at AppearanceMenus.