Site icon WP Smith

What Are Custom Post Types?

Understanding WordPress Custom Post Types
When I first heard about custom post types (CPTs) less than a year ago when I was introduced to WordPress 3.0 (even though they've been around since 2005), I thought that custom post types would change, revolutionize WordPress making it more than a blogging platform, more than a content management system (CMS). And it has and will continue to change how web WordPress developers develop, if they haven't already. However, it took me longer to understand custom post types than I had expected, primarily because of my lack of proximity and "need" for them. Yet my lack of "need" for them was because I learned how to highjack categories to make WordPress do what I wanted. However, my lack of need for them was only driven by my lack of understanding them. Instead of "hacking" or manipulating categories or tags to do the leg work, custom post types can do the customized work for you, quickly, easily, and simply.

What are Custom Post Types NOT?

Custom post types are not just "blog posts" in the traditional sense for "post" is one post type. They are not a replacement for custom fields for custom post types work in tandem with custom fields. They are not taxonomies for custom post types are associated with taxonomies and vice versa. Creating custom post types are not completely GUI (Graphical User Interface) driven innately (or out of the box) in WordPress. However, with some premium plugins like Easy Content Types and GD Custom Posts And Taxonomies Tools as well as some "free" plugins like Custom Post Types UI Plugin and WP Easy Post Types, custom post types graphical user interfacing has made great strides in what could easily be incorporated into WordPress core, if Automattic so choses to move towards a more GUI approach.

What ARE Custom Post Types?

First up, to clear some misconceptions, Custom Post Types should be really be called Custom Content Types. As Mark Jaquith aptly says (and even admits):

These [Custom Post Types] were poorly named. Think: Custom Content Types. That is, non-post content. Examples: employees, products, attachments, menu items, pages, pets. If you want it to show up in your site’s main RSS feed, then it’s probably not a custom post type.

Instead, custom post types are "content" types. A page is a post type. A post is a post type. They can be used to store information or data and/or administer, arrange or display different types of content on the site. WordPress uses various post types: pages, posts, revisions, attachments, and nav menus, of which custom post types stand along side.

  1. Posts: default content type for blog posts displayed in reverse sequential order by post time
  2. Pages: default content type for static pages which can use page templates and organized via hierarchical structure
  3. Attachments: default content type for images, etc
  4. Revisions: default content type for post, etc., revisions
  5. Nav Menus: default content type for the custom nav menu
  6. Custom Post Types (Custom Content Types): Can be whatever we want, define, and set, e.g., events, podcasts, movies, cars, etc.

Thinking "custom content types" when someone says "custom post types" avoids the confusion with WordPress's posts. Some custom post type examples include:

Simply it is or can be anything that can be better arranged that isn't a "post" or a "page." Just think about those things that we all too often thought, "There's got to be a better way to present this information than a page or a post!" Custom post types should be something custom. It should have a custom submission area with specific meta content (via custom meta boxes and custom fields). The submission area should look and feel different from a normal post or page submission area.

For more information stay tuned. Until then, consider these posts:

Helpful Links:

  1. WordPress Codex: Custom Post Types
  2. WordPress Codex: Register Post Type
  3. Custom Post Types in WordPress
  4. How to Create a WordPress Custom Post Type Template in .Genesis Framework
  5. Submit Post Form for WordPress Custom Post Type