Chapter 7

Custom Post Types, Custom Taxonomies, and Metadata

WHAT’S IN THIS CHAPTER?

  • Understanding and creating custom post types
  • Displaying and using custom post type content
  • Creating and using custom taxonomies
  • Understanding and using metadata

The most important part of any WordPress website is the content. WordPress, by default, has various types of content and taxonomies defined, but often, you will need to define your own types of content to build the exact website you want.

Over the past few years, WordPress has introduced some very advanced, and easy-to-use, tools for working with all sorts of custom content. This has helped WordPress evolve into a full-fledged content management system capable of powering absolutely any type of website setup, regardless of the content.

In this chapter, you learn how to create custom post types and content in WordPress. You also learn how to work with custom taxonomies to group and classify your content. Finally, you learn how to attach and retrieve arbitrary pieces of metadata to your content.

UNDERSTANDING DATA IN WORDPRESS

When working with various types of data in WordPress, it’s important to understand what that data is and how it can be customized. WordPress has five predefined post types in a default installation:

1. Post — Blog posts or articles generally ordered by date
2. Page — Hierarchical static pages of content
3. Attachment — Media uploaded to WordPress and attached to post type entries, such as images and files
4. Revision ...

Get Professional WordPress: Design and Development, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.