Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Guides Post type

if ( ! function_exists('guide_post_type') ) {

// Register Custom Post Type
function guide_post_type() {

	$labels = array(
		'name'                => _x( 'Guides', 'Post Type General Name', 'text_domain' ),
		'singular_name'       => _x( 'Guide', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'           => __( 'Guide', 'text_domain' ),
		'name_admin_bar'      => __( 'Guide', 'text_domain' ),
		'parent_item_colon'   => __( 'Parent Guide:', 'text_domain' ),
		'all_items'           => __( 'All Guides', 'text_domain' ),
		'add_new_item'        => __( 'Add New Guide', 'text_domain' ),
		'add_new'             => __( 'Add New Guide', 'text_domain' ),
		'new_item'            => __( 'New Guide', 'text_domain' ),
		'edit_item'           => __( 'Edit Guide', 'text_domain' ),
		'update_item'         => __( 'Update Guide', 'text_domain' ),
		'view_item'           => __( 'View Guide', 'text_domain' ),
		'search_items'        => __( 'Search Guide', 'text_domain' ),
		'not_found'           => __( 'Guide Not found', 'text_domain' ),
		'not_found_in_trash'  => __( 'Guide Not found in Trash', 'text_domain' ),
	);
	$rewrite = array(
		'slug'                => 'guides',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);
	$args = array(
		'label'               => __( 'guide', 'text_domain' ),
		'description'         => __( 'Add a tour guide page', 'text_domain' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'page-attributes', 'post-formats', ),
		'taxonomies'          => array( 'guides_cat' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 20,
		'menu_icon'           => 'f330',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => true,
		'can_export'          => true,
		'has_archive'         => 'guides',
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'query_var'           => 'guide',
		'rewrite'             => $rewrite,
		'capability_type'     => 'page',
	);
	register_post_type( 'guide', $args );

}

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

}