ADDING CUSTOMIZE POST IN WORDPRESS WITH TAGS AND CATEGORIES

Put this code in your functions.php


function create_post_type() {
  register_post_type( 'arman_product',
    array(
      'labels' => array(
        'name' => __( 'Products' ),
        'singular_name' => __( 'Product' )
      ),
      'public' => true,
      'has_archive' => true,
	  'rewrite' => array('slug' => 'products')
    )
  );
 //add Categories and Tags in dropdown of the Products
 register_taxonomy_for_object_type('category', 'arman_product');
 register_taxonomy_for_object_type('post_tag', 'arman_product');
}
add_action( 'init', 'create_post_type' );

visit: https://codex.wordpress.org/Function_Reference/register_post_type

Advertisements
This entry was posted in WORDPRESS. Bookmark the permalink.

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