The custom post type functionality was added to WordPress in version 3.0 because people wanted to be able to specify new objects. The most commonly known objects are posts and pages, but there are actually already three other custom types in the WordPress backend: attachments, revisions, and nav menus.
We're going to create a custom post type named book.
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.
To register a new post type, all ...