Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

One Page Events Listing

CPT for displaying list of events on a single page with no single pages

// Register Custom Post Type
function event() {

	$labels = array(
		'name'                => 'Events',
		'singular_name'       => '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'           => 'No events found',
		'not_found_in_trash'  => 'No events found in Trash',
	);
	$args = array(
		'label'               => 'event',
		'description'         => 'Event listings for event page',
		'labels'              => $labels,
		'supports'            => array( 'title', 'thumbnail', 'custom-fields', ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 20,
		'menu_icon'           => 'dashicons-calendar-alt',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => true,
		'can_export'          => true,
		'has_archive'         => false,		
		'exclude_from_search' => true,
		'publicly_queryable'  => true,
		'rewrite'             => false,
		'capability_type'     => 'post',
	);
	register_post_type( 'event', $args );

}

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