Fields marked with an * are required

Following is a small presentation on custom post type for letting you know what we cover in our training program, however if you want more comprehensive tutorial on Custom Post types you should read our four part tutorial on Custom Post type and custom fields.

Creating Custom Post type?

WordPress has five default inbuilt post type (Pages, Posts, Attachments, Revision, Navigation Menu)

And you can create your own custom post type it can be added to wordpress by register_post_type() function.

You must call register_post_type() before the admin_menu and after the after_setup_theme action hooks.

add_action( ‘init’, ‘create_post_type’ );

function create_post_type() {

                register_post_type( ‘acme_product’,

                                array(

                                                ‘labels’ => array(

                                                                ‘name’ => __( ‘Products’ ),

                                                                ‘singular_name’ => __( ‘Product’ )

                                                ),

                                ‘public’ => true,

                                ‘has_archive’ => true,

                                )

                );

}

This will create a post name product. The register function has two arguments one is label which defines the post type in singular and plural form and the second is public which is a predefined flag to show the post type on admin screen .


Recent Feedback !!

I had spent a month searching for a good institution and a professional teacher and you are really what I’M searching .

– Digvijay

New Delhi

Great job! Keep up the good work.

– Shrishti

Noida

It is amazing. Whatever I don’t understand, I found it very Beneficial for those who can’t go out for studies or the people who really need a professional training Think n code makes you a professional developer.

– Gurmeet

Chandigarh

Thanks to Think n code Now ,I am able to create site in CMS like drupal and wordpress with the knowledge of Cusomization.

– gaurav

Hariyana

From the first day of my class I enjoyed my training I love the way you teach.

– Aparna

Delhi

Leave a Reply

Scroll to Top