Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Music Genres

Gigsmith

// Register Custom Taxonomy
function custom_taxonomy_music_genre() {

	$labels = array(
		'name'                       => _x( 'Genres', 'Taxonomy General Name', 'gigsmith' ),
		'singular_name'              => _x( 'Genre', 'Taxonomy Singular Name', 'gigsmith' ),
		'menu_name'                  => __( 'Musical Genres', 'gigsmith' ),
		'all_items'                  => __( 'All Items', 'gigsmith' ),
		'parent_item'                => __( 'Parent Item', 'gigsmith' ),
		'parent_item_colon'          => __( 'Parent Item:', 'gigsmith' ),
		'new_item_name'              => __( 'New Item Name', 'gigsmith' ),
		'add_new_item'               => __( 'Add New Item', 'gigsmith' ),
		'edit_item'                  => __( 'Edit Item', 'gigsmith' ),
		'update_item'                => __( 'Update Item', 'gigsmith' ),
		'view_item'                  => __( 'View Item', 'gigsmith' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'gigsmith' ),
		'add_or_remove_items'        => __( 'Add or remove items', 'gigsmith' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'gigsmith' ),
		'popular_items'              => __( 'Popular Items', 'gigsmith' ),
		'search_items'               => __( 'Search Items', 'gigsmith' ),
		'not_found'                  => __( 'Not Found', 'gigsmith' ),
		'no_terms'                   => __( 'No items', 'gigsmith' ),
		'items_list'                 => __( 'Items list', 'gigsmith' ),
		'items_list_navigation'      => __( 'Items list navigation', 'gigsmith' ),
	);
	$rewrite = array(
		'slug'                       => 'genre',
		'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'              => true,
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'music_genre', array( 'post' ), $args );

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