O'Reilly logo

WordPress 3 Complete by April Hodge Silver

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

Creating a custom post type: book

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.

Registering a new post type

To register a new post type, all ...

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