Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Create event taxonomy

// Register Custom Taxonomy
function create_event_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Events', 'Taxonomy General Name', 'ueg' ),
		'singular_name'              => _x( 'Event', 'Taxonomy Singular Name', 'ueg' ),
		'menu_name'                  => __( 'Events', 'ueg' ),
		'all_items'                  => __( 'All Event', 'ueg' ),
		'parent_item'                => __( 'Parent Event', 'ueg' ),
		'parent_item_colon'          => __( 'Parent Event', 'ueg' ),
		'new_item_name'              => __( 'New Event Name', 'ueg' ),
		'add_new_item'               => __( 'Add New Event', 'ueg' ),
		'edit_item'                  => __( 'Edit Event', 'ueg' ),
		'update_item'                => __( 'Update Event', 'ueg' ),
		'separate_items_with_commas' => __( 'Separate events with commas', 'ueg' ),
		'search_items'               => __( 'Search Events', 'ueg' ),
		'add_or_remove_items'        => __( 'Add or remove event', 'ueg' ),
		'choose_from_most_used'      => __( 'Choose from the most used events', 'ueg' ),
		'not_found'                  => __( 'Not Found', 'ueg' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => false,
	);
	register_taxonomy( 'event', 'custom_post_type', $args );

}

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