Custom Post Types

Hard to explain, easy to use

WordPress themes can register custom post types to make certain types of rich content easier to edit and organise. Providing custom post types in a theme makes things easier for content editors and reduces the risk of breaking the design of the site.

You can generally tell if your theme allows editing content via custom post types by seeing content type menus in the main sidebar, as shown in the example from 5th Element Expeditions below.

5th Element Expeditions has a custom post type for Testimonials, which can be added and organised like a normal blog post.

Custom post types are most useful for certain elements on the site that are used often and generally require the same types of attributes. How the custom post type is used is dependent on your specific WordPress theme, but in this example, Testimonials are simple custom posts with only the fields needed to produce a good looking testimonial. The post title is used for the name, the content for the actual testimonial, the featured image for the photo and the occupation field.


Backend editing of the custom post.


Frontend display of the custom post

One of the advantages of using a custom post type rather than, say, a shortcode inserted on a page, means that editing or reordering the custom posts will take effect in all places the custom post type appears on the frontend. Using shortcodes or adding these types of elements directly to pages can often mean having to update them in various different places when making any change.

WordPress Custom Fields - NextNextPrev - ShortcodesPrev