Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

GRC Vendors CPT

if ( ! function_exists('vendors_registration') ) {

// Register Custom Post Type
function vendors_registration() {

	$labels = array(
		'name'                  => _x( 'Vendors', 'Post Type General Name', 'grc' ),
		'singular_name'         => _x( 'Vendor', 'Post Type Singular Name', 'grc' ),
		'menu_name'             => __( 'Vendors', 'grc' ),
		'name_admin_bar'        => __( 'Vendors', 'grc' ),
		'archives'              => __( 'Vendor Archives', 'grc' ),
		'attributes'            => __( 'Vendor Attributes', 'grc' ),
		'parent_item_colon'     => __( 'Parent Vendor:', 'grc' ),
		'all_items'             => __( 'All Vendors', 'grc' ),
		'add_new_item'          => __( 'Add New Vendor', 'grc' ),
		'add_new'               => __( 'Add New', 'grc' ),
		'new_item'              => __( 'New Vendor', 'grc' ),
		'edit_item'             => __( 'Edit Vendor', 'grc' ),
		'update_item'           => __( 'Update Vendor', 'grc' ),
		'view_item'             => __( 'View Vendor', 'grc' ),
		'view_items'            => __( 'View Vendors', 'grc' ),
		'search_items'          => __( 'Search Vendor', 'grc' ),
		'not_found'             => __( 'Not Vendors found', 'grc' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'grc' ),
		'featured_image'        => __( 'Vendor Logo', 'grc' ),
		'set_featured_image'    => __( 'Set Vendor Logo', 'grc' ),
		'remove_featured_image' => __( 'Remove Vendor Logo', 'grc' ),
		'use_featured_image'    => __( 'Use as Vendor Logo', 'grc' ),
		'insert_into_item'      => __( 'Insert into Vendor', 'grc' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Vendor', 'grc' ),
		'items_list'            => __( 'Vendors list', 'grc' ),
		'items_list_navigation' => __( 'Vendors list navigation', 'grc' ),
		'filter_items_list'     => __( 'Filter Vendors list', 'grc' ),
	);
	$args = array(
		'label'                 => __( 'Vendor', 'grc' ),
		'description'           => __( 'Vendors, more information soon.', 'grc' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'thumbnail', ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => false,
		'can_export'            => true,
		'has_archive'           => true,		
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'capability_type'       => 'post',
	);
	register_post_type( 'vendors', $args );

}
add_action( 'init', 'vendors_registration', 0 );

}