Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

TEI In Store Events

// Register Custom Post Type
function create_events() {

	$labels = array(
		'name'                => 'In Store Events',
		'singular_name'       => 'In Store Event',
		'menu_name'           => 'Events',
		'name_admin_bar'      => 'Events',
		'parent_item_colon'   => 'Parent Event:',
		'all_items'           => 'All Events',
		'add_new_item'        => 'Add New Event',
		'add_new'             => 'Add New',
		'new_item'            => 'New Event',
		'edit_item'           => 'Edit Event',
		'update_item'         => 'Update Event',
		'view_item'           => 'View Event',
		'search_items'        => 'Search Events',
		'not_found'           => 'Not found',
		'not_found_in_trash'  => 'Not found in Trash',
	);
	$rewrite = array(
		'slug'                => 'events',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);
	$args = array(
		'label'               => 'store_event',
		'description'         => 'Use to list and display in store events.',
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'thumbnail', ),
		'taxonomies'          => array( 'event_category' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 10,
		'menu_icon'           => 'dashicons-calendar-alt',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => false,
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'rewrite'             => $rewrite,
		'capability_type'     => 'post',
	);
	register_post_type( 'store_event', $args );

}

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