Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Testimonial Category

if ( ! function_exists( 'gt_testimonial_taxonomy' ) ) {

// Register Custom Taxonomy
function gt_testimonial_taxonomy() {

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

}

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

}