WordPress create custom post types/taxonomies


Custom Post Types are a new set of administrative options appearing along with the default post types such as Posts, Pages, Attachments etc. A Custom Post Type can store any type of information. It has a editor, media uploader and uses the existing WordPress table structure for ease in data management.

By default, WordPress comes with 3 taxonomies:post tag, categories and link categories. Essentially, a taxonomy is a way of classifying data.

You can learn how to create custom meta boxes/meta data of wordpress, check the following link of my previous post.
WordPress create custom meta boxes

ok.Let’s start.First check the following diagram how about the custom post type’s look. I’m going to explain this using “portfolio” custom post type.
Wordpress custom post types

Creating a custom post types/taxonomies

Open your theme’s folder functions.php file and add the following codes at the end of that file.

1-Add the following hook to execute the custom function during the initialization phase every time a page is generated.Here ‘my_custom_post_portfolio’ is a custom function name.

2-Create the custom function and add arguments to implement as menu item.


Registering the custom post type.

Description about the post type.

Determines the visibility of the custom post type both in the admin panel and front end.

The menu position of the custom post type.

The features of the custom post type which is to be displayed.

Enables archiving of the custom post type.

Displays the admin menu icon.

After saving the page you can see the result from admin panel.

More details


About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.