Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Listing Type

// Register Custom Taxonomy
function listing_type() {

	$labels = array(
		'name'                       => _x( 'Business Categories', 'Taxonomy General Name', 'hm_listing_type' ),
		'singular_name'              => _x( 'Business Category', 'Taxonomy Singular Name', 'hm_listing_type' ),
		'menu_name'                  => __( 'Category', 'hm_listing_type' ),
		'all_items'                  => __( 'All Categories', 'hm_listing_type' ),
		'parent_item'                => __( 'Parent Category', 'hm_listing_type' ),
		'parent_item_colon'          => __( 'Parent Category:', 'hm_listing_type' ),
		'new_item_name'              => __( 'New Category Name', 'hm_listing_type' ),
		'add_new_item'               => __( 'Add New Category', 'hm_listing_type' ),
		'edit_item'                  => __( 'Edit Category', 'hm_listing_type' ),
		'update_item'                => __( 'Update Category', 'hm_listing_type' ),
		'view_item'                  => __( 'View Category', 'hm_listing_type' ),
		'separate_items_with_commas' => __( 'Separate Categories with commas', 'hm_listing_type' ),
		'add_or_remove_items'        => __( 'Add or remove Categories', 'hm_listing_type' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'hm_listing_type' ),
		'popular_items'              => __( 'Popular Categories', 'hm_listing_type' ),
		'search_items'               => __( 'Search Categories', 'hm_listing_type' ),
		'not_found'                  => __( 'Not Found', 'hm_listing_type' ),
		'no_terms'                   => __( 'No Categories', 'hm_listing_type' ),
		'items_list'                 => __( 'Categories list', 'hm_listing_type' ),
		'items_list_navigation'      => __( 'Categories list navigation', 'hm_listing_type' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'show_in_rest'               => true,
	);
	register_taxonomy( 'listing_type', array( 'hm_listings' ), $args );

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