Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

News Group

// Register Custom Taxonomy
function news_group_taxonomy() {

	$labels = array(
		'name'                       => _x( 'News Group', 'Taxonomy General Name', 'text_domain' ),
		'singular_name'              => _x( 'News Group', 'Taxonomy Singular Name', 'text_domain' ),
		'menu_name'                  => __( 'News Group', 'text_domain' ),
		'all_items'                  => __( 'All News Groups', 'text_domain' ),
		'parent_item'                => __( 'Parent News Group', 'text_domain' ),
		'parent_item_colon'          => __( 'Parent News Group:', 'text_domain' ),
		'new_item_name'              => __( 'New News Group Name', 'text_domain' ),
		'add_new_item'               => __( 'Add New News Group', 'text_domain' ),
		'edit_item'                  => __( 'Edit News Group', 'text_domain' ),
		'update_item'                => __( 'Update News Group', 'text_domain' ),
		'separate_items_with_commas' => __( 'Separate News Group's with commas', 'text_domain' ),
		'search_items'               => __( 'Search News Groups', 'text_domain' ),
		'add_or_remove_items'        => __( 'Add or remove news groups', 'text_domain' ),
		'choose_from_most_used'      => __( 'Choose from the most used news groups', 'text_domain' ),
		'not_found'                  => __( 'Not Found', 'text_domain' ),
	);
	$rewrite = array(
		'slug'                       => 'news/group',
		'with_front'                 => true,
		'hierarchical'               => false,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => false,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => false,
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'news_group', 'custom_post_type', $args );

}

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