How to Create Custom Post Types in WordPress

Today i will tell you that “How to Create Custom Post Types in WordPress”

People mistakenly classify WordPress as just a blogging platform, but WordPress is most popular cms in these days.By default WordPress have post and pages as the main content types. However you can create as many custom content types as you like, and these custom content types are called ‘Custom Post Types’.

You can create your own custom post types and call them whatever you want. For example if you want a member review website, then you want to create a member post type. This post type can have different custom fields and even its own custom category structure.

Create Custom Post Type Using Plugin

The easiest way to create a custom post type in WordPress is by using a plugin. This method is recommended for beginner because it is safe and super easy.

For this you have to install plugin named “Custom Post Type UI”.This plugin provides an easy to use interface to create and administer custom post types and taxonomies in WordPress.

Creating a Custom Post Type Manually

The main problem with using a plugin is, your custom post types will disappear when the plugin is deactivated. Any data you have in custom post still be there, but your custom post type will be unregistered and won’t be accessible from the admin area.

You can register custom post type easily using code which you can paste in your theme function file.below code will help you to register.

It registers a post type ‘members’ with an array of arguments. These arguments are the options of our custom post type.

If you want to learn more about register_custom_post_type just go to WordPress Function Post Type, and you can learn in dept.

Displaying Custom Post Types on Your Site

After register and add content in custom post type now time to display the output in your theme, just paste below code where you want to display your custom post type data.

Above code display your output of custom post type you can add or call more fields according to your choice like, for show wordpress default custom field or custom field plugins field using below code –

you can read WordPress function details also for more details.