Let’s Create a Custom Post Type Using Plugin.

Step 1 : Create WordPress Plugin Directory in plugin Folder.
Open your WordPress Plugin directory and create a new directory called CUSTOM POST TYPE NAME.

Step 2 :Create PHP File in your created folder.
Open the directory and create a PHP file named CUSTOM POST TYPE NAME.php.

Step 3 : Add Header in CUSTOM POST TYPE NAME.php

    Plugin Name: Movie Reviews
    Plugin URI: https://shahkeyul.wordpress.com/
    Description: This is Test Plugin for Create Custom Post Type you have 
                  to give your plugin description as per your demand.
    Version: 1.0
    Author: Expert Developer
    Author URI: https://shahkeyul.wordpress.com/

Step 4 : Open your CUSTOM POST TYPE NAME.php file write down below code.

function create_CUSTOM_FUNTION_NAME() {
    register_post_type( 'CUSTOM POST TYPE NAME',
            'labels' => array(
                'name' => 'CUSTOM POST TYPE NAME',
                'singular_name' => 'CUSTOM POST TYPE NAME',
                'add_new' => 'Add New',
                'add_new_item' => 'Add New CUSTOM POST TYPE NAME',
                'edit' => 'Edit',
                'edit_item' => 'Edit CUSTOM POST TYPE NAME',
                'new_item' => 'New CUSTOM POST TYPE NAME',
                'view' => 'View',
                'view_item' => 'View CUSTOM POST TYPE NAME',
                'search_items' => 'Search CUSTOM POST TYPE NAME',
                'not_found' => 'No CUSTOM POST TYPE NAME found',
                'not_found_in_trash' => 'No CUSTOM POST TYPE NAME found in Trash',
                'parent' => 'Parent CUSTOM POST TYPE NAME'
            'public' => true,
            'menu_position' => 15,
            'supports' => array( 'title', 'editor', 'comments', 'thumbnail', 'custom-fields' ),
            'taxonomies' => array( '' ),
            'menu_icon' => plugins_url( 'images/image.png', __FILE__ ),
            'has_archive' => true

NOTE: CUSTOM POST TYPE NAME Replace With your Custom Post type Name.

Step 5 :

  • ‘public’ => true determines the visibility of the custom post type both in the admin panel and front end.
  • ‘menu_position’ => 15 determines the menu position of the custom post type.
  • ‘supports’ => array( ‘title’, ‘editor’, ‘comments’, ‘thumbnail’, ‘custom-fields’ ) determines the features of the custom post type which is to be displayed.
  • ‘taxonomies’ => array( ” ) creates custom taxonomies. Here it’s not defined.
  • ‘menu_icon’ => plugins_url( ‘images/image.png’, __FILE__ ) displays the admin menu icon.
  • ‘has_archive’ => true enables archiving of the custom post type.
  • Step 3 : Register Custom Function

     add_action( 'init', 'create_CUSTOM_FUNTION_NAME' );

    In Second parameter we have to pass our Custom function Name.

    Step 6 : Define your Icon For custom post type.
    save your images in plugin folder/images/YOUR IMG FILE NAME.

    Step 7 : Activate your Plugin.
    For That you have go in admin panel –> Plugins –> Activate your plugin.

    Step 8 : you can see the new custom post type at admin side. Now add the Custom Post .


    Leave your comments

    Please log in using one of these methods to post your comment:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )


    Connecting to %s