Wordpress 3 and Custom Post Types
I am super excited about Wordpress 3! It isn’t in the final release yet as of today (April 2010), but it is coming to many a websites real soon. We have been working with a project recently that is using version 3 (in beta), and various enhancement are going to revolutionize Wordpress as a content management system. Most notably the Custom Posts Feature.
In a nutshell the way Wordpress is set up in previous versions is like this: at the very basic you have Posts, and Pages. These are your (very) basic content types, Posts are items in your blog, and Pages are basic static-type pages. In previous versions, if you want to have a custom sections or want to hack Wordpress to be more like a content management system, you would have to create a special category (or tag) in your blog, and pull in that category (or tag) on the front end (in a template file) to show the custom content. One of the main issues are that the blog is for blog posts and if you are putting everything into your blog, you have to filter the blogs display so it doesn’t show your custom content in the blog.
Now with version 3 and Custom Post Types you can create and new “Post Type” for this custom content, and even have a separate area in the admin for the content type. Let’s say for example you want to have a “Portfolio” feature that displays your portfolio, but you don’t want that content in the blog. You will be able to create a “Portfolio” custom post type and this area will now show up as a collapsible section like your Pages, and Posts do in the admin.
This feature is great for clients who need a straight forward management system for their content they update. If you want to add addition info to go along with your custom post type you can create a series of Taxonomies which were introduced in version 2.3. For example: Let’s say your Portfolio “post” needs associated fields with it like Client, Project Type, and Industry, instead of using the custom fields feature (which is sure to confuse most clients), you can use the taxonomies and pull that data in. Taxonomies are a lot like categories are in the blog, except they can be used as categories for your custom post type. Now in the admin panel when creating a new “Portfolio” post, you will have taxonomies displaying like categories do, and can select/create the appropriate related info to go along with your Portfolio post.
The custom posts require you to add some code into your site, but a cool plug-in called Custom Post Type UI lets you create your custom post types and custom taxonomies in the back-end. Check out their video on the plug-in page which explains custom posts in greater detail using the example of “Movies” as a custom post type.