Custom Post Types and Taxonomies in WordPress

The most recent versions of WordPress includes the ability to include custom post types and taxonomies. What that heck is that? Well basically it allows you to put other kinds of data into WordPress, rather than just simply posts and pages, and then tag or classify that data in other ways than just tags and categories. A Great example is this P2 theme I’m using for this blog: it has several options at the top posting area: Status Update, Blog Post, Quote, and Link. Currently these are all the normal, default post type. There is a normal category assigned to each kind. The theme knows whether or not to display a title, based on which category its in. But lets say you wanted to use categories to classify your posts. Automattic (creators of WP and the P2 theme) could make each of these a custom post type, or they could create a custom set of taxonomies. If they did both, you’d be able to select “Status Update”, “Quote”, and “Link” in the WP admin, then specifically write that kind of post (e.g. a “Status Update” post would only have a body field, no title option) rather than only as an option on the front of P2, as it is now. Plus, if there was a custom taxonomy assigned to each you could still sort by the type, but you’d also be free to use categories for your own classification.

This all only works if you incorporate the custom post types & taxonomies into the theme. You can create them, but if the theme doesn’t know what to do with them, they’re worthless. An example of the custom post types is on the home page of my business website: FiddlerStudios.com. The images and text carousel that is the main focus of the home page, are each a custom post type. It looks a lot like a normal post, but the theme knows to put them the text in that carousel, with the featured image on the left, rather than in the blog with normal news posts.

With that said, here’s a really great explanation explanation I found regarding custom taxonomies. And here’s a great plugin that lets you quickly and easily create custom post types and taxonomies in your WP admin. The problem with the plugin is its only half the battle: you’ll still need to make your theme make use of them.

UPDATE: here’s an excellent and very detailed article about all the details of custom post types.

, , , ,

2 Responses to Custom Post Types and Taxonomies in WordPress

  1. Bill June 30, 2011 at 7:34 pm #

    Great write up. I’m trying to get the link button in the top to work on a fresh install but no luck.

    I see the code in the post-form.php, but it looks right.

    Great post. Thanks

    • Tevya June 30, 2011 at 9:00 pm #

      Not sure I’m following Bill. Which link button?

Leave a Reply