Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Trainers CPT

// Register Custom Post Type
function pft_trainers() {

	$labels = array(
		'name'                => 'Trainers',
		'singular_name'       => 'Trainer',
		'menu_name'           => 'Trainers',
		'name_admin_bar'      => 'Trainers',
		'parent_item_colon'   => 'Parent Trainer:',
		'all_items'           => 'All Trainers',
		'add_new_item'        => 'Add New Trainer',
		'add_new'             => 'Add New',
		'new_item'            => 'New Trainer',
		'edit_item'           => 'Edit Trainer',
		'update_item'         => 'Update Trainer',
		'view_item'           => 'View Trainer',
		'search_items'        => 'Search Trainer',
		'not_found'           => 'Not found',
		'not_found_in_trash'  => 'Not found in Trash',
	);
	$args = array(
		'label'               => 'trainer',
		'description'         => 'Post Type for Trainers',
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'thumbnail', 'revisions', 'custom-fields', ),
		'taxonomies'          => array( 'category', 'post_tag', 'locations' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 20,
		'menu_icon'           => 'dashicons-hammer',
		'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( 'trainer', $args );

}

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