A new feature in WordPress (new as of version 3.0) is a feature called custom post types. This feature allows you, the site owner, to create different content types for your WordPress site that give you more creative control over how different types of content are entered, published, and displayed on your WordPress Web site.
Personally, we wish WordPress had called this feature custom content types so that people didn't incorrectly think that custom post types pertain to posts only. Custom post types aren't really the posts that you know as blog posts. Custom post types are a different way of managing content on your blog, by defining what type of content it is, how it is displayed on your site, and how it operates — but they're not necessarily posts.
By default, WordPress already has different post types built into the software, ready for you to use. These default post types include
Custom post types give you the ability to create new and useful types of content on your Web site, including a smart and easy way to publish those content types to your site.
You really have endless possibilities for how to use custom post types, but here are a few ideas that can kick-start your imagination (they're some of the most popular and useful ideas that others have implemented on their sites):
In order to create and use custom post types on your site, you need to be sure that your WordPress theme contains the correct code and functions. In the following steps, we create a very basic custom post type called Generic Content. Follow these steps to create the Generic Content basic custom post type:
Scroll down to the bottom of the functions.php file and include the following code to add a Generic Content custom post type to your site:
add_action( 'init', 'create_my_post_types' ); function create_my_post_types() { register_post_type( 'generic_content', array( 'label' => __( 'Generic Content' ), 'singular_label' => __( 'Generic Content' ), 'description' => __( 'This is a description of the Generic Content type' ), 'public' => true, ) }
The function register_post_type can accept several different arguments and parameters, which are detailed in Table 6-2. You can use a variety and combination of different arguments and parameters to create a specific post type. You can find more information on custom post types and using the register_post_types function in the official WordPress Codex at http://codex.wordpress.org/Function_Reference/register_post_type.
After you complete the preceding steps to add the Generic Content custom post type to your site, a new post type labeled Generic appears in the left navigation menu of the Dashboard.
You can add and publish new content by using the new custom post type, just like when you write and publish blog posts (see Book IV, Chapter 1). The published content isn't added to the chronological listing of blog posts, but rather, it's treated like separate content from your blog (just like static pages).
View the permalink for it, and you see that it adopts the post type name Generic Content and uses it as part of the permalink structure, creating a permalink that looks like http://yourdomain.com/generic-content/new-article.
Two very helpful plugins for building custom post types pretty quickly in WordPress are
3.15.46.221