O'Reilly logo

WordPress Plugin Development Cookbook by Yannick Lefebvre

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding custom categories for custom post types

To keep items organized in a site, administrators often use the built-in WordPress categories and terms to identify similar items. Looking back at the Book Review System that we have been putting in place so far in this chapter, a type of categorization that would be helpful is a book type (for example, Science-Fiction, Documentary, Fiction, Poetry, and so on).

This recipe shows how to create a new category (known as a taxonomy in the WordPress backend) and associate it with the Book Review custom post type.

Getting ready

You should have already followed the Displaying custom post type data in shortcodes and Displaying single custom post type items using custom templates recipes to have a starting point ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required