Unlock your potential with a Pro Membership
Here is where you propel your career forward. Come join us today. Learn more.
Relationship Between Post, Taxonomy, & Terms
Lab: WordPress Built-in Taxonomy Basics
Video Runtime: 14:22
Let’s talk about the relationship between the post, taxonomy, and terms. To an author, the relationship looks like it’s the interface where s/he writes and configures the content. But this interface is just a graphic representation of the content in the database. Therefore, this episode is a technical relationship discussion.
WordPress gives us a graphic that shows the relationship of taxonomies to their terms. This table shows you that categories are hierarchical, meaning each term can have a child, grandchildren, and so on. Think of it like a tree, where there are levels. Tags and post formats can have just one level.
On a technical basis, the relationship between post, taxonomy, and terms is defined within the database. It is defined in the following database tables:
wp_posts
wp_term_relationships
wp_term_taxonomy
wp_termmeta
wp_terms
Posts can have many taxonomies and many terms. A taxonomy can have many terms. Terms have one taxonomy and many posts. Notice the words that I’m using: one-to-many and many-to-many. These terms define our database relationships and then how you architect the tables. This is why we have so many database tables. Let’s talk about that.
Key Take-aways
The key points and take-aways from this episode are:
- The editor in the back-end is an interface. It’s being populated by code. The code pulls and saves the content and configuration data to/from the database.
- Therefore, technically the data is in the database. The interface represents the data in the database.
- The relationship is a many-to-many.
Want to know more about the database?
If you want to know more about the database, then go do these labs:
Who needs copy/paste? Right. Writing code from scratch is fun!
Episodes
Total Lab Runtime: 01:17:16
- 1 Lab Introductionfree 02:17
- 2 What is a Taxonomy?free 10:12
- 3 What are Terms?free 08:53
- 4 Relationship Between Post, Taxonomy, & Termspro 14:22
- 5 Get the Registered Taxonomiespro 15:35
- 6 Dive into WordPress Corepro 03:17
- 7 Get the Terms for a Taxonomypro 08:19
- 8 Get the Taxonomies for a Post Typepro 02:50
- 9 Archive for Taxonomy or Termpro 04:14
- 10 Explore Other Functionspro 07:17