Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Team Member C.P.T.

The Team Member custom post type will be used with the Department Taxonomy to provide an easy way to manage staff for an organization.

if ( ! function_exists('mle_cpt') ) {

// Register Custom Post Type
function mle_cpt() {

	$labels = array(
		'name'                  => _x( 'Team Members', 'Post Type General Name', 'mle_custom_post_types' ),
		'singular_name'         => _x( 'Team Member', 'Post Type Singular Name', 'mle_custom_post_types' ),
		'menu_name'             => __( 'Team Members', 'mle_custom_post_types' ),
		'name_admin_bar'        => __( 'Team Member', 'mle_custom_post_types' ),
		'archives'              => __( 'Team Member Archives', 'mle_custom_post_types' ),
		'attributes'            => __( 'Team Member Attributes', 'mle_custom_post_types' ),
		'parent_item_colon'     => __( 'Parent Team:', 'mle_custom_post_types' ),
		'all_items'             => __( 'All Team Members', 'mle_custom_post_types' ),
		'add_new_item'          => __( 'Add New Team Member', 'mle_custom_post_types' ),
		'add_new'               => __( 'Add New Team Member', 'mle_custom_post_types' ),
		'new_item'              => __( 'New Team Member', 'mle_custom_post_types' ),
		'edit_item'             => __( 'Edit Team Member', 'mle_custom_post_types' ),
		'update_item'           => __( 'Update Team Member', 'mle_custom_post_types' ),
		'view_item'             => __( 'View Team Member', 'mle_custom_post_types' ),
		'view_items'            => __( 'View Team Members', 'mle_custom_post_types' ),
		'search_items'          => __( 'Search Team Member', 'mle_custom_post_types' ),
		'not_found'             => __( 'Team Member Not found', 'mle_custom_post_types' ),
		'not_found_in_trash'    => __( 'Team Member Not found in Trash', 'mle_custom_post_types' ),
		'featured_image'        => __( 'Featured Image', 'mle_custom_post_types' ),
		'set_featured_image'    => __( 'Set featured image', 'mle_custom_post_types' ),
		'remove_featured_image' => __( 'Remove featured image', 'mle_custom_post_types' ),
		'use_featured_image'    => __( 'Use as featured image', 'mle_custom_post_types' ),
		'insert_into_item'      => __( 'Insert into Team Member', 'mle_custom_post_types' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Team Member', 'mle_custom_post_types' ),
		'items_list'            => __( 'Team Members list', 'mle_custom_post_types' ),
		'items_list_navigation' => __( 'Team Members list navigation', 'mle_custom_post_types' ),
		'filter_items_list'     => __( 'Filter Team Members list', 'mle_custom_post_types' ),
	);
	$args = array(
		'label'                 => __( 'Team Member', 'mle_custom_post_types' ),
		'description'           => __( 'Post Type Description', 'mle_custom_post_types' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'author', 'thumbnail', 'revisions', ),
		'taxonomies'            => array( 'departments' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,		
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'capability_type'       => 'page',
	);
	register_post_type( 'team_members', $args );

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

}