Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Earl – Traver Resources Categories

if ( ! function_exists( 'travel_resources_custom_taxonomy' ) ) {

// Register Custom Taxonomy
function travel_resources_custom_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Travel Resource Categories', 'Taxonomy General Name', 'wandering_earl' ),
		'singular_name'              => _x( 'Travel Resource Category', 'Taxonomy Singular Name', 'wandering_earl' ),
		'menu_name'                  => __( 'Travel Resource Category', 'wandering_earl' ),
		'all_items'                  => __( 'All Categories', 'wandering_earl' ),
		'parent_item'                => __( 'Parent Category', 'wandering_earl' ),
		'parent_item_colon'          => __( 'Parent Item:', 'wandering_earl' ),
		'new_item_name'              => __( 'New Travel Resource Category', 'wandering_earl' ),
		'add_new_item'               => __( 'Add New Travel Resource Category', 'wandering_earl' ),
		'edit_item'                  => __( 'Edit Travel Resource Category', 'wandering_earl' ),
		'update_item'                => __( 'Update Travel Resource Category', 'wandering_earl' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'wandering_earl' ),
		'search_items'               => __( 'Search Items', 'wandering_earl' ),
		'add_or_remove_items'        => __( 'Add or remove items', 'wandering_earl' ),
		'choose_from_most_used'      => __( 'Choose from the most used items', 'wandering_earl' ),
		'not_found'                  => __( 'Not Found', 'wandering_earl' ),
	);
	$rewrite = array(
		'slug'                       => 'traver-resources-categories',
		'with_front'                 => true,
		'hierarchical'               => true,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => false,
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'travel_resource_categories', array( 'travel-resources' ), $args );

}

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

}