Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

CPT Martha Timeline

Timeline Event nodes for Martha’s medical history.

// Register Custom Post Type
function bish_cpt_timenode() {

	$labels = array(
		'name'                => _x( 'Timeline Events', 'Post Type General Name', 'melanomas' ),
		'singular_name'       => _x( 'Timeline Event', 'Post Type Singular Name', 'melanomas' ),
		'menu_name'           => __( 'Timeline Events', 'melanomas' ),
		'parent_item_colon'   => __( 'Parent Event:', 'melanomas' ),
		'all_items'           => __( 'All Events', 'melanomas' ),
		'view_item'           => __( 'View Event', 'melanomas' ),
		'add_new_item'        => __( 'Add New Event', 'melanomas' ),
		'add_new'             => __( 'Add New', 'melanomas' ),
		'edit_item'           => __( 'Edit Event', 'melanomas' ),
		'update_item'         => __( 'Update Events', 'melanomas' ),
		'search_items'        => __( 'Search Events', 'melanomas' ),
		'not_found'           => __( 'Not found', 'melanomas' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'melanomas' ),
	);
	$args = array(
		'label'               => __( 'time_node', 'melanomas' ),
		'description'         => __( 'Event to display in Timeline', 'melanomas' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'comments', 'custom-fields', ),
		'taxonomies'          => array( 'category', 'post_tag' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 5,
		'menu_icon'           => '',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'page',
	);
	register_post_type( 'time_node', $args );

}

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