Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

IZO – Awards CPT

// Register Custom Post Type
function cpt_awards() {

	$labels = array(
		'name'                  => _x( 'Awards', 'Post Type General Name', 'izo' ),
		'singular_name'         => _x( 'Award', 'Post Type Singular Name', 'izo' ),
		'menu_name'             => __( 'Awards', 'izo' ),
		'name_admin_bar'        => __( 'Awards', 'izo' ),
		'archives'              => __( 'Award Archives', 'izo' ),
		'attributes'            => __( 'Award Attributes', 'izo' ),
		'parent_item_colon'     => __( 'Parent Award:', 'izo' ),
		'all_items'             => __( 'All Awards', 'izo' ),
		'add_new_item'          => __( 'Add New Award', 'izo' ),
		'add_new'               => __( 'Add New', 'izo' ),
		'new_item'              => __( 'New Award', 'izo' ),
		'edit_item'             => __( 'Edit Award', 'izo' ),
		'update_item'           => __( 'Update Award', 'izo' ),
		'view_item'             => __( 'View Award', 'izo' ),
		'view_items'            => __( 'View Awards', 'izo' ),
		'search_items'          => __( 'Search Award', 'izo' ),
		'not_found'             => __( 'Not found', 'izo' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'izo' ),
		'featured_image'        => __( 'Featured Award Image', 'izo' ),
		'set_featured_image'    => __( 'Set featured award image', 'izo' ),
		'remove_featured_image' => __( 'Remove featured award image', 'izo' ),
		'use_featured_image'    => __( 'Use as featured award image', 'izo' ),
		'insert_into_item'      => __( 'Insert into award', 'izo' ),
		'uploaded_to_this_item' => __( 'Uploaded to this award', 'izo' ),
		'items_list'            => __( 'Awards list', 'izo' ),
		'items_list_navigation' => __( 'Awards list navigation', 'izo' ),
		'filter_items_list'     => __( 'Filter awards list', 'izo' ),
	);
	$args = array(
		'label'                 => __( 'Award', 'izo' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'thumbnail', 'revisions', ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-awards',
		'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( 'awards', $args );

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