Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Stores

Post Type Stores

// Register Custom Post Type
function stores() {

	$labels = array(
		'name'                  => 'Stores',
		'singular_name'         => 'Store',
		'menu_name'             => 'Stores',
		'name_admin_bar'        => 'Store',
		'archives'              => 'Item Archives',
		'attributes'            => 'Item Attributes',
		'parent_item_colon'     => 'Parent Store:',
		'all_items'             => 'All Stores',
		'add_new_item'          => 'Add New Store',
		'add_new'               => 'New Store',
		'new_item'              => 'New Item',
		'edit_item'             => 'Edit Store',
		'update_item'           => 'Update Store',
		'view_item'             => 'View Store',
		'view_items'            => 'View Items',
		'search_items'          => 'Search stores',
		'not_found'             => 'No stores found',
		'not_found_in_trash'    => 'No stores found in Trash',
		'featured_image'        => 'Featured Image',
		'set_featured_image'    => 'Set featured image',
		'remove_featured_image' => 'Remove featured image',
		'use_featured_image'    => 'Use as featured image',
		'insert_into_item'      => 'Insert into item',
		'uploaded_to_this_item' => 'Uploaded to this item',
		'items_list'            => 'Items list',
		'items_list_navigation' => 'Items list navigation',
		'filter_items_list'     => 'Filter items list',
	);
	$rewrite = array(
		'slug'                  => 'shop/stores',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$capabilities = array(
		'edit_post'             => 'edit_post',
		'read_post'             => 'read_post',
		'delete_post'           => 'delete_post',
		'edit_posts'            => 'edit_posts',
		'edit_others_posts'     => 'edit_others_posts',
		'publish_posts'         => 'publish_posts',
		'read_private_posts'    => 'read_private_posts',
	);
	$args = array(
		'label'                 => 'Store',
		'description'           => 'Store information pages.',
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats' ),
		'taxonomies'            => array( 'arts_crafts', 'baby_nursery', 'beauty_fragrance', 'books_magazines', 'cameras_optics', 'car_garage', 'clothing_shoes', 'collectibles_memorabilia', 'computing', 'electronics', 'flowers', 'gourmet food_chocolate.health_wellness', 'home furnishings', 'jewelry_watches', 'kitchen_housewares', 'lawn_garden', 'miscellaneous', 'movies', 'music', 'musical instruments', 'office products', 'pet supplies', 'software', 'sports_outdoors', 'tools_hardware', 'toys', 'travel', 'vehicles', 'video games' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => 'shop/stores',
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'query_var'             => 'stores',
		'rewrite'               => $rewrite,
		'capabilities'          => $capabilities,
		'show_in_rest'          => true,
	);
	register_post_type( 'stores', $args );

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