Chapter 11. Extending Posts: Metadata, Custom Post Types, and Taxonomies


  • Creating custom post types

  • Using custom post types

  • Adding and using post metadata

  • Creating custom taxonomies

  • Using custom taxonomies

In WordPress, posts represent the content of the site. Content is typically the most important aspect of having a web site. Taxonomies are a way to classify or categorize posts. Metadata is additional information about individual posts. Each of these things can be brought together to make any type of web site imaginable.

Throughout this chapter, you work on building a single plugin that houses a user's music collection. Both the post types and taxonomies sections of this chapter contribute to the overall plugin. Nearly every snippet of code provided within this chapter contributes to the plugin and gives you a view of how the topics presented work together to manage content.

One important thing to note about post types, post metadata, and taxonomies is that their display is typically controlled by themes when on the frontend of the site, so plugin developers don't always have complete control over how this is handled. Of course, this depends on what functionality the plugin is providing to the user. WordPress theme development is outside the scope of this book, but learning how themes work within the WordPress environment can make your plugin development skills stronger.


By default, WordPress has several predefined post types that enable ...

Get Professional WordPress® Plugin Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.