Things change rapidly in the WordPress world. The content in this post is more than a year old and may no longer represent best practices.
Anita Cheng walked us through the use of the Pods framework to create custom post types, custom taxonomies, custom fields, and relationships between post types, as well as the creation of Pods display templates, based on the site she built for the IA Summit.
Set It and Forget It: Structured Content in WordPress with the Pods FrameworkPods Framework WP presentation
Structured Content and Software Architecture
WordPress themes are a total failure with regard to structured content, especially themes that create custom post types and custom taxonomies in their functions.php files instead of using plugins.
In a well-run restaurant, these roles don’t overlap. The cooks don’t take orders from the diners, because they’re busy cooking! The waiters don’t cook, because they’re making sure the diners are having a good experience. And let’s hope the diners don’t have to create dishes for themselves in a restaurant!
Likewise, on a well-run WordPress site, the theme only deals with the presentation of the content. Extra functionality comes from plugins and should persist across themes. If you think about the MVC (Model, Controller, View) pattern of software architecture, the theme should only address the view. Plugins are a combination of model and controller.
There are several plugins that help you to create custom post types, custom taxonomies, and custom fields. Pods not only makes it easy to create new content types, fields, and taxonomies, but also to display them. Unlike ACF (which creates fields and relationships, but not post types or taxonomies) or Toolset Types, it’s completely free. Plus there’s great support through the Pods Slack Community, mostly in the person of Jim True. (Anita is helping to write the docs, and there’s also a Pods Framework YouTube channel.) For Anita personally, it was also important to find a tool that wouldn’t require her to write PHP.
Building the IA Summit Website
It would be embarrassing for a conference about information architecture to have a site with poorly structured content, but when Anita took it on, it was a mess of half-completed Drupal imports. In conceptualizing the new website, she started by addressing content strategy.
Analysis of past conferences and what people said about them made it clear that for attendees, at least, IA Summit was all about the people. That made the “person” post type, its fields, and its relationships to other post types extremely important.
Connecting Post Types
In addition to creating several new post types, Anita needed to connect them to each other so that, for instance, it was possible to show talks, posters, and interviews on a speaker page, and speaker bio info on “talk” pages and in blog posts.
Displaying Pods Content
You can build Pods display templates in the WordPress admin using “magic tags” which work like merge fields in MailChimp. Your templates can include conditionals to further customize what information shows up where. You can also insert these Pods templates into any page or post with shortcodes.
For those who prefer writing code, you can also add Pods content with functions, though some of the docs on this are not complete yet.
Next time you need to build a site that needs custom post types, custom taxonomies, custom fields, and post relationships, you should definitely check out Pods.