Understanding WordPress Custom Taxonomy

I have been working a bit with the new Custom Taxonomies to develop a small business directory site that is aimed at the local community where I live.  However, diving into custom taxonomy head first left me not really understand the basics from the ground up so I spent some time looking for a guide to gain a better understanding.  Thanksfully, John Gadbois put together a great guide.  I will walk through the guide as well as add some of my own thoughts.

To start off with we can define what a Taxonomy is according to the WordPress Codex:

Taxonomyis one of those words that most people never hear or use. Basically, a taxonomy is a way to group things together.

For example, I might have a bunch of different types of animals. I can group them together according to various characteristics and then assign those groups names. This is something most people encounter in biology classes, and it is known as the Linnaean Taxonomy.

In WordPress, a “taxonomy” is a grouping mechanism for some posts (or links).

In fact it seems taxonomies are very common to anyone using WordPress.  We know them as things like a Category or Tag.  This makes sense when we take into consideration the above definition. So to summarize, a WordPress Taxonomy is a way to group posts.  The posts can be the standard blog posts or they can be custom posts.  Taxonomies can be added to drill down into post types even further and segment things more than is available with the current Category and Tag methods.  One quick illustration on how they could be useful is if you had a travel blog and wanted to create a Taxonomy called say “state.” This could allow you to drill down and sort posts by what part of the country they were written about while retaining the usefulness of your category and tag attributes.

It is also worth talking about the real beauty of using taxonomies — through custom taxonomies with custom post types. In our business directory site for example, we would want to use “Business Category” as a taxonomy so that we can group business listings by their particular offering or industry.  This will allow visitors to quickly sort the listings in a very clean and easy to understand way.

Johns guide then takes you through some coding on how to create specific custom taxonomies, I suggest you look at the snippets he provides to get a feel for what they look like and take a shot at implementing some of your own.

Leave a Reply

Your email address will not be published. Required fields are marked *