Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

mrdi_testimonial_post_type

if ( ! function_exists('mrdi_testimonial_post_type') ) {

// Register Custom Post Type
function mrdi_testimonial_post_type() {

	$labels = array(
		'name'                  => _x( 'Testimonials', 'Post Type General Name', 'mrdi-td' ),
		'singular_name'         => _x( 'Testimonial', 'Post Type Singular Name', 'mrdi-td' ),
		'menu_name'             => __( 'Testimonials', 'mrdi-td' ),
		'name_admin_bar'        => __( 'Testimonial', 'mrdi-td' ),
		'archives'              => __( 'Testimonial archives', 'mrdi-td' ),
		'parent_item_colon'     => __( 'Parent testimonial:', 'mrdi-td' ),
		'all_items'             => __( 'All testimonials', 'mrdi-td' ),
		'add_new_item'          => __( 'Add new testimonial', 'mrdi-td' ),
		'add_new'               => __( 'Add New', 'mrdi-td' ),
		'new_item'              => __( 'New testimonial', 'mrdi-td' ),
		'edit_item'             => __( 'Edit testimonial', 'mrdi-td' ),
		'update_item'           => __( 'Update testimonial', 'mrdi-td' ),
		'view_item'             => __( 'View testimonial', 'mrdi-td' ),
		'search_items'          => __( 'Search testimonial', 'mrdi-td' ),
		'not_found'             => __( 'Not found', 'mrdi-td' ),
		'not_found_in_trash'    => __( 'Not found in trash', 'mrdi-td' ),
		'featured_image'        => __( 'Featured image', 'mrdi-td' ),
		'set_featured_image'    => __( 'Set featured image', 'mrdi-td' ),
		'remove_featured_image' => __( 'Remove featured image', 'mrdi-td' ),
		'use_featured_image'    => __( 'Use as featured image', 'mrdi-td' ),
		'insert_into_item'      => __( 'Insert into testimonial', 'mrdi-td' ),
		'uploaded_to_this_item' => __( 'Uploaded to this testimonial', 'mrdi-td' ),
		'items_list'            => __( 'Testimonials list', 'mrdi-td' ),
		'items_list_navigation' => __( 'Testimonials list navigation', 'mrdi-td' ),
		'filter_items_list'     => __( 'Filter testimonials list', 'mrdi-td' ),
	);
	$args = array(
		'label'                 => __( 'Testimonial', 'mrdi-td' ),
		'description'           => __( 'Video testimonial', 'mrdi-td' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
		'taxonomies'            => array( 'universe' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-format-video',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => 'testimonial',
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'query_var'             => 'testimonial',
		'capability_type'       => 'post',
	);
	register_post_type( 'testimonial', $args );

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

}