Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Genre Updated

Genre Updated

if ( ! function_exists( 'film_genre_taxonomy' ) ) {

// Register Custom Taxonomy
function film_genre_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Genres', 'Taxonomy General Name', 'unite-child' ),
		'singular_name'              => _x( 'Genre', 'Taxonomy Singular Name', 'unite-child' ),
		'menu_name'                  => __( 'Genre', 'unite-child' ),
		'all_items'                  => __( 'All Genres', 'unite-child' ),
		'parent_item'                => __( 'Parent Genre', 'unite-child' ),
		'parent_item_colon'          => __( 'Parent Genre:', 'unite-child' ),
		'new_item_name'              => __( 'New Genre Name', 'unite-child' ),
		'add_new_item'               => __( 'Add New Genre', 'unite-child' ),
		'edit_item'                  => __( 'Edit Genre', 'unite-child' ),
		'update_item'                => __( 'Update Genre', 'unite-child' ),
		'view_item'                  => __( 'View Item', 'unite-child' ),
		'separate_items_with_commas' => __( 'Separate genres with commas', 'unite-child' ),
		'add_or_remove_items'        => __( 'Add or remove genres', 'unite-child' ),
		'choose_from_most_used'      => __( 'Choose from the most used genres', 'unite-child' ),
		'popular_items'              => __( 'Popular Items', 'unite-child' ),
		'search_items'               => __( 'Search genres', 'unite-child' ),
		'not_found'                  => __( 'Not Found', 'unite-child' ),
		'no_terms'                   => __( 'No items', 'unite-child' ),
		'items_list'                 => __( 'Items list', 'unite-child' ),
		'items_list_navigation'      => __( 'Items list navigation', 'unite-child' ),
	);
	$capabilities = array(
		'manage_terms'               => 'manage_genres',
		'edit_terms'                 => 'manage_genre',
		'delete_terms'               => 'manage_genres',
		'assign_terms'               => 'edit_posts',
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'capabilities'               => $capabilities,
	);
	register_taxonomy( 'genre', array( 'films' ), $args );

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

}