While building some of the sites described in the current and the previous chapters, you may stumble upon what're called custom post types. Or you may even decide to create them yourself for the purpose of your individual projects. But let's take it from the top. The most commonly known types of content in WordPress are posts and pages. However, if we feel that the situation/project calls for it, we can create any number of new post types by taking advantage of the custom post type functionality and its wide versatility.
The need for custom post types can appear in many scenarios. For instance, when a writer is building a personal portfolio site, they might need a custom post type named book to present their publications in an attractive way, instead of just using standard posts. This is exactly what we're about to do in this section of the chapter. So, gear up to learn how custom post types work by building a new one.
For this purpose, we'll go back to our main cooking blog theme—Daily Cooking Custom. In its default form, it doesn't feature any custom post types, and that's a good thing as we've got a blank canvas to work on. To specify that you'd like to have a custom post type in your theme, you can add some code to your theme's functions.php file. This is what we'll be doing. However, keep in mind that you can also attach the custom post type to a plugin or a widget if you don't want it to be tied to a particular theme.