While WordPress is commonly used as a blogging platform, it is turning into a Content Management System software, or “CMS,” with every release of WordPress. Unlike WordPress, other CMS software offer posts types for an element of a page: “Posts” that will appear on the front page, “Pages” that are included behind the site with a help of a sidebar or header link, and “Media” pages to include various types of audio and video files for video and audio blogging.

With the recent release of WordPress 3.0, it is possible to do this without a use of a plugin. With previous WordPress releases, the only options available were “Post” and “Pages.” But with “Custom Post Types,” you can add content specifically for products, podcasts, videos, event databases, message boards, and many more.

When you add a custom post type, your posts filed under the post types will get their own area, whereas the Post and Pages are sorted by their respectful type. To implement this, you must be familiar with HTML and PHP. If you do not know much about programming languages but would like to give it a try, it is recommended to backup the files mentioned in the event that mistakes are made or if you prefer to use a plugin than I recommend Custom Post Type UI

In your theme’s “functions.php” file, you will find settings specifically made for the theme, such as theme options, global appearance of comments, and other hooks not already called by WordPress, which is going to be added. On a new line, we are going to create an “Announcements” post type. Begin the Post Type function with:

add_action(‘init’, ‘custom_post_type’);

After adding the line, we begin the function script to setup the Announcements type:

function custom_post_type() {
register_post_type( ‘announcements’, array( ‘labels’ => array( ‘name’ => __(‘Announcements’), ‘singular_name’ => __(‘Announcement’) ), ‘public’ => true, ) );
}

When the “function” is declared, it will be called when WordPress calls the function. Within “function”, we set up an array after “register_post_type()” that WordPress requires to create an “announcement” post type: The “labels” array show the “name” and “singular_name”, where the page will display “Announcements” and “Announcement” (without the “S”) on the admin page, respectfully.

The “public” declaration determines whether the post type should be displayed in by visitors and overwrites individual settings that are set to “true” or “false” to show the User Interface in the admin area or exclude the post type from search results on the front end.

After saving the file and visiting the admin area, you will see an option section of the sidebar specifically for Announcement posts. You can now add and manage announcements that differ from posts and pages of a WordPress site. This is a simple method of adding custom post types in WordPress 3.0 immediately. However, the WordPress Codex has an extended explanation to further customize post types.

Avatar of Govindji Patel

About

I am Author/Publisher WordPress Coach and Consultant who enjoys writing tutorials and helping wordpress users build better WordPress website/blog.

Related Posts

blog comments powered by Disqus
Premium wordpress theme
Skype Status
Need Help with Wordpress Chat with me - Govindji Patel: My status is Unknown
» Get Skype, call free! If Offline please leave Message
Become A Fan
Free Report

WordPress Optimization Secrets

Get Your Blog To Rank Higher

Register and Download Free Report

Twenty Eleven Child Theme

Upgrade and get set of 35 videos on

how to create and customize child theme

Buy Me Coffee
Donation



Other Amount:



I appreciate a donation if you find my tutorials helpfull :



Your privacy will never be compromised or shared.
Congratulations

Thank you for Subscribing Please check your email for a confirmation email