Created: 2017.07.06
Essentially, a taxonomy is a way of classifying data. Typically a taxonomy will have a set of characteristics that is unique to it - A Basic Explanation of WordPress Taxonomies
Taxonomies apply to posts and pages - and anything else
If you're not attaching your taxonomy to posts, then you may not get the interface created for you. Taxonomies are generic, after all, you could create one for any sort of object - Taxonomies
You can create Custom Taxonomies for any content type in WordPress - WORDPRESS 3.1 FOR DESIGNERS
Not Part of Custom Post Types, though typically used with them - WORDPRESS 3.1 FOR DESIGNERS
Posts can live in multiple categories - A Basic Explanation of WordPress Taxonomies
You don't register "child" or "parent" taxonomies. You add (child-)terms to a hierarchical taxonomy - How to register child taxonomies?
Each tag or category you create is a “term” within that taxonomy. For example, if you create a category “Movies” (in our site about entertainment), “Movies” becomes a term within the category taxonomy. - A Basic Explanation of WordPress Taxonomies
In a post, each taxonomy appears as a meta box.
In this box:
- Each category created within that Taxonomy in the Admin UI has a checkbox
- Each term programmatically added with
wp_insert_term
has a checkbox
These items are output as siblings. This does not mirror the intended hierarchy.
Adding separate taxonomies creates separate meta boxes, but this makes authoring cumbersome.
From a UX perspective, I don't want to have to select taxonomic terms like 'Tour Leg' at the post level. I only want to drill down from the Tour, (optionally) to the Tour Leg, so that I understand the context of the latter.
With Don't Believe The Hype:
- A Tour post may be within a Tour leg - metabox
- A Tour post must be within a Tour - programmatic or metabox
- A Tour must be within a Tour region - programmatic
I use custom taxonomies with custom post types, to:
- assign ACF fields to those specific taxonomies
- avoid polluting non-tour posts with tour specific ACF baggage
The three levels of context provide users with multiple ways to find information.
- The structure favoured by the site owner (taxonomy provides context)
- Internal or external Search (post name and custom post type slug provides context)
- The site menus (custom post type provides context)
This provides context when the taxonomy is not present / the filter is inactive.
place1-to-place2
(tour stage)
The catchy page title is reserved for the Heading 1.
The SEO page title is reserved for the <title>
element.
A grouping or collection of posts of a non-generic type. The CPT provides some structure, but finding a specific post could be difficult without the context provided by the taxonomy. On the other hand, if the user is not interested in reading a tour sequentially, browsing the Tour Diaries in a flat form might be preferable.
The CPT slug should be specific enough to differentiate this content, and make sense at any level that the user drills down to.
A plural slug and name are most appropriate.
This is why tours
is not an appropriate CPR. A diary entry is not a tour. But tourdiaries
is appropriate, because every post is a page in the diary.
- Slug:
tourdiaries
- Every day is a tour diary
- A diary is semantically also a collection of diary entries
- Out-of-the-box, a WordPress CPT comes with: single post view (
single-tourdiaries.php
), index view (archive-tourdiaries.php
)
A grouping or collection of terms or classifications which can be used to filter or classify posts. The CPT provides some structure, but finding a specific post could be difficult without the context provided by the taxonomy. On the other hand, if the user is not interested in reading a tour sequentially, browsing the Tour Diaries in a flat form might be preferable.
Defined first, but sits parallel to the Custom Post Type. Could be queried separately?
A plural slug and name are most appropriate.
- Slug:
%tours%
, replaced by the assigned tour Term (e.g.east-asia-2015
) or Hierarchical Terms (e.g.east-asia-2015/mongolia
) - Out-of-the-box, a WordPress CT comes with: index view (
taxonomy-tour.php
)
An optional classification or filter. Like a folder structure, but one that can be 'folded up'. In other words, all of the following contexts are 'true':
/tourdiaries/east-asia-2015/china-1/1/place1-to-place2
(the post is a diary of a sequential day, from a regional tour/leg, that is part of a global tour)/tourdiaries/east-asia-2015/place1-to-place2
(the post is a diary of a day, from a specific global tour) (folded once)/tourdiaries/place1-to-place2
(the post is a diary of a day, from a tour) (folded twice)