This month I had the pleasure of speaking at High Ed Web in Grand Rapids. After my talk, I sat in on Daniel Spillers’ presentation where he discussed the University of Arkansas Little Rock’s usage of custom post types. While we have been using custom post types for years, I realized we’re in the minority. Daniel and his presentation reminded me that custom post types are a magical world that most WordPress users have yet to explore.
What are Custom Post Types?
Custom post types are simply a way of categorizing and separating content within WordPress. They allow you to segment content into different areas of the WordPress admin panel and provide unique sets of data per data type. You can then use this data to create custom displays for users on the live website.
Custom post types extend WordPress’s past simple pages and posts. They allow you to create a variety of new content types that create an easy to use entry system for users, which is augmented by very specific and unique templates for presenting this data to website visitors.
Some Real World Applications of Custom Post Types
One of my first WordPress website projects included a mini directory of motorcycles segmented by manufacturer and feature such as model year, price, style, and usage type. Back then the only method I had for creating this website was using WordPress posts and performing some fancy segmentation via the plain old post tags. It was a very cool website for 2009.
Had I built that same website today, I would have had a much easier time and this is because we now have custom post types (CPT) available within WordPress. The usage of CPTs would have given me the mini-database I needed and it would have allowed a lot more flexibility with displaying data segments and presenting these in a stylish manner.
Now that custom post types are available, we use them a lot. We do so because they allow greater flexibility with graphic design and they are much easier for our clients to manage on an ongoing basis.
Examples of custom post type usage include testimonials, portfolios, products, FAQs, staff directories, white paper listings, new articles, industries, etc.
Custom Taxonomies Make CPT’s Even Better
Custom post types can be extended by adding custom taxonomies. A taxonomy is a way of grouping like content together. WordPress already does this with blog categories and tags. By adding custom taxonomies, you can extend this base functionality by grouping content in lots of different ways and use it in a wide range of applications.
By joining custom post types and taxonomies, you extend WordPress from a small business website and blogging software into an enterprise-level application.
Where Do You Code Custom Post Types?
There is a lot of debate about building CPT code into the theme or a standalone plugin. This debate can quickly be dismissed by asking yourself one simple question – will you ever want to change your WordPress theme? If the answer to that is yes, then you should always build out custom post types into a plugin so the data and code are portable from one theme to another.
At Web Savvy we build a custom plugin for each custom post type we create. This keeps it separate from the theme and will maintain the data integrity should our client want to move from one WordPress theme to another in future years.
This is important and is definitely something someone should be aware of when purchasing WordPress themes with advanced functionality.