# Custom Page Type

Follow this tutorial to create a new custom post type like "Project" in this example.

1. Go to the directory of the wordpress website in `public_html/wp-content/plugins`
2. Create a new folder and name it `custom-post-type`
3. Create a file inside that folder and name it `custom-post-type.php`
4. Copy the following code inside that php file and save it

```php
<?php
/*
Plugin Name: Custom Post Types
Description: Add post types for custom project
Author: Sikka Software
*/
// Hook ss_custom_post_custom_article() to the init action hook
add_action( 'init', 'ss_custom_post_custom_project' );
// The custom function to register a custom article post type
function ss_custom_post_custom_project() {
    // Set the labels. This variable is used in the $args array
    $labels = array(
        'name'               => __( 'Custom Projects' ),
        'singular_name'      => __( 'Custom Project' ),
        'add_new'            => __( 'Add New Custom Project' ),
        'add_new_item'       => __( 'Add New Custom Project' ),
        'edit_item'          => __( 'Edit Custom Project' ),
        'new_item'           => __( 'New Custom Project' ),
        'all_items'          => __( 'All Custom Project' ),
        'view_item'          => __( 'View Custom Project' ),
        'search_items'       => __( 'Search Custom Project' ),
        'featured_image'     => 'Poster',
        'set_featured_image' => 'Add Poster'
    );
// The arguments for our post type, to be entered as parameter 2 of register_post_type()
    $args = array(
        'labels'            => $labels,
        'description'       => 'Holds our custom project post specific data',
        'public'            => true,
        'menu_position'     => 5,
        'supports'          => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments', 'custom-fields' ),
        'has_archive'       => true,
        'show_in_admin_bar' => true,
        'show_in_nav_menus' => true,
        'query_var'         => true,
    );
    // Call the actual WordPress function
    // Parameter 1 is a name for the post type
    // Parameter 2 is the $args array
    register_post_type('project', $args);
}
```

5. Navigate to the website admin dashboard and activiate the plugin

Congratulations, now you have created a custom post type. To avoid conflict with other plugins, your custom function should have a prefix like **ss\_.**
