Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Tedx Events

if ( ! function_exists( 'jw_custom_taxonomy' ) ) {

// Register Custom Taxonomy
function jw_custom_taxonomy() {

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

}

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

}