Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Documentary Taxonomy

Piece of code used to relate each fragment with their documentary (many fragments to one and only one documentary)

if ( ! function_exists( 'documentary' ) ) {

// Register Custom Taxonomy
function documentary() {

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

}

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

}