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!

Advertisements

Sr. Software Engineer

Tagged with: , , ,
Posted in Wordpress
7 comments on “How register/create new custom post type using hooks in wordpress site?
  1. sex game says:

    Thanks to my father who stated to me on the topic of this weblog, this
    weblog is actually remarkable.

  2. 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.

  3. But wanna say that this is invaluable , Thanks for taking your time to write this.

  4. Really nice design and superb written content , very little else we want : D.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: