WordPress Custom Post Types Explained
In this tutorial, we look at WordPress custom post types:
- What custom post types are
- How custom post types differ from default post types
- How custom post types can give your site unlimited expansion possibilities.
We’ll begin by looking at how custom post types differ from default post types.
Custom Post Types vs Default Post Types
WordPress is a true Content Management System (CMS) in the sense that it not only allows you to manage content but to manage and display different types of content.
For simplicity’s sake, let’s call the most basic unit of content stored in the WordPress database a post.
WordPress can hold and display a number of default post types.
The default post types most WordPress users are familiar with are posts and pages.
If you need help understanding the difference between posts and pages, see this tutorial: WordPress Posts vs WordPress Pages Explained.
WordPress, however, has additional default post types it uses to store and manage the types of content it needs to perform various built-in functions.
WordPress default post types include:
- Post – This is the post type typically used in blogs, web articles, and RSS feeds. Regular posts normally displayed in reverse chronological order (i.e. newest posts first).
- Page – A page is like a post, but it lives outside the normal time-based listings of posts. Pages can use different page templates and be organized in a hierarchical structure (i.e. parent pages with nested pages). Pages normally cannot be assigned categories and tags. If permalinks are enabled, page permalinks comprise the main site URL and the slug of the page and/or parent pages. See WordPress Posts vs WordPress Pages for more information about the differences.
- Attachment – An attachment is a special post that holds information about a file uploaded through the WordPress media upload system, such as its description and name, image size, post thumbnails, image alt text, etc.
- Revision – Revision posts store draft posts and past revisions of a published post.
- Navigation Menu – Navigation Menu is a type of post that holds information about a single item in the WordPress navigation menu system.
- Custom CSS – Custom CSS is a theme-specific post used to store CSS saved from the “Additional CSS” screen of the WordPress Theme Customizer.
- Changesets – Changesets is a post type similar to auto-saves but specifically for the Theme Customizer. If you’re making changes to your theme through the Customizer and something happens, this post type can help you restore your unsaved changes.
You can learn more about WordPress default post types in the official WordPress Codex.
Custom Post Types
In addition to the default post types shown above, WordPress also lets you (i.e. developers) create new post types for specific purposes.
Some examples of custom post types include:
- Directory Listings
Custom post types are normally added to WordPress when you install plugins or themes designed to help you perform specific purposes.
For example, if you run an eCommerce website, you can add new products to your site through a ‘product’ post. This is a custom post type specifically designed to store and display information about products (e.g. product name, product description, product image, pricing, availability, etc.)
Additional custom post types include FAQs…
Directory listings …
With WordPress, there is no limit to the types of content you can create, store and display on your website.
If you can’t find a plugin or theme that will give the type of content you need, you can always ask a web developer to code or customize a custom post type for your website.
Hopefully, now you have a better understanding of what custom post types are and how they are used in WordPress.