How to create custom post type in wordpress ?

custom post type in wordpress

Add this code to your website theme functions.php file..

<?php
function nst_custom_post() { register_post_type( 'Movie', array( 'labels' => array( 'name' => __( 'Movie' ),
'singular_name' => __( 'Movie' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'movie'),
'supports' => array('title', 'editor','thumbnail','excerpt','custom-fields'),
)
);
}
// Hooking up our function to theme setup
add_action( 'init', 'nst_custom_post' );
?>

 

Here is the preview of that code… you can change name as per your need.

custom post type in wordpress

 

 

If this help you then.. Can you buy a Cup of Coffee for me by nst webcreation paypal--OR-- nst webcreation blog coffee cup

Published by

NST

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

Related Articles

3 thoughts on “How to create custom post type in wordpress ?”

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to Chat