Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Products

// Register Custom Post Type
function products() {

	$labels = array(
		'name'                => _x( 'Products', 'Post Type General Name', 'sef' ),
		'singular_name'       => _x( 'Product', 'Post Type Singular Name', 'sef' ),
		'menu_name'           => __( 'Products', 'sef' ),
		'parent_item_colon'   => __( 'Parent Product:', 'sef' ),
		'all_items'           => __( 'All Products', 'sef' ),
		'view_item'           => __( 'View Product', 'sef' ),
		'add_new_item'        => __( 'Add New Product', 'sef' ),
		'add_new'             => __( 'Add New', 'sef' ),
		'edit_item'           => __( 'Edit Product', 'sef' ),
		'update_item'         => __( 'Update Product', 'sef' ),
		'search_items'        => __( 'Search Product', 'sef' ),
		'not_found'           => __( 'Not found', 'sef' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'sef' ),
	);
	$args = array(
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'revisions', ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 20,
		'menu_icon'           => '',
		'can_export'          => false,
		'has_archive'         => false,
		'exclude_from_search' => false,
		'publicly_queryable'  => false,
		'capability_type'     => 'post',
	);
	register_post_type( 'product', $args );

}

// Hook into the 'init' action
add_action( 'init', 'products', 0 );