Understanding Custom Post Types and Taxonomies in WordPress
It’s important to understand what custom post types and taxonomies are. Out of the box, WordPress has several different posts types already to find. And the most common ones, the one you interact on a daily basis are posts and pages. So let’s take a look at what custom posts and pages are because this will be instructive when you create your own custom post types.
Default post types
Posts are what you normally create on WordPress. They are organized in a reverse chronological order so that the last post goes first in the index and you see the rest of the posts below. Posts are non-hierarchial instead, they are organized based on the author who creates them, the date they were published and also using categories and tags. Every post must have a category and all posts can have tags.
In contrast, pages have single individual items that can be displayed in a parent-child relationship and you usually see this on the main menu. Pages don’t have indexed categories and tags, so the only way to get to them is the direct link which is why they usually appear in the main menus. Post are normally used for any kind of recently updated item like a news article whereas pages are used for static content that is rarely updated and is usually made to be available to inform the visitor about what is going on the site.
Custom Post Types
When you create a custom post type, you can create a post type that acts either like a post or like a page. Whatever one you choose, the new custom post type the inherit all the features of either posts or pages. If you set the custom post type to act like a post, it can be organized by categories, tags or custom taxonomies or a combination of all of these.
Custom post types have separate index pages and you can have custom index templates. You can even call in a custom post type from anywhere within your site using a custom loop.
Taxonomy is a scheme of classification, an organizational system that allows you to relate one item to other similar items in a hierarchical or non-hierarchial group. In WordPress you have two types of taxonomies that you use all the time which are:
Categories are mandatory. Every post must have a category. They are displayed in a hierarchical system so you can have a parent-child relationship between. These are the main organizational method within WordPress.
Tags are optional. You can use them whenever you want. They are non-hierarchial which means they are not related to any other tags in any way. These are the secondary organizational method on WordPress.
Why should you use custom taxonomies?
When you create custom taxonomies, you can create either hierarchical taxonomies like categories or non-hierarchial taxonomies like tags. These taxonomies can be applied to one or several post types including posts. Custom taxonomies can have a custom index and archive templates, so you can display them differently from how you would display the category and tag indexes. The good thing about custom taxonomies is, they allow for more advanced organization of your content.
Latest posts by Christine (see all)
- Top 5 Ways to Wire up ESP8266 Module to your Arduino Uno Board - September 22, 2017
- Get started with a Fingerprint Sensor Module using Arduino - September 13, 2017
- How to Print AT Commands with ESP8266 using USB TTL Converter - September 12, 2017