How register/create new custom post type using hooks in wordpress site?

hello everyone


If you are planning to create a custom post type then use my code, hope you will enjoy my code.

Add this code in your theme function file

add_action( 'init', 'create_post_type' );
function create_post_type() {
	register_post_type( 'R_News',
		array(
			'labels' => array(
				'name' => __( 'News' ),
				'singular_name' => __( 'News' )
			),
		'public' => true,
		'has_archive' => true,
                'supports' => array( 'title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail' )
		)
	);
}

Enjoy Code!

7 Replies to “How register/create new custom post type using hooks in wordpress site?”

  1. You could certainly see your skills within the work you
    write. The arena hopes for even more passionate writers like you who are not afraid to mention how they believe.
    At all times follow your heart. “Until you walk a mile in another mans moccasins you cant imagine the smell.” by Robert Byrne.

Leave a Reply

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