Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

cpt_projekt

if ( ! function_exists('projekt') ) {

// Register Custom Post Type
function projekt() {

	$labels = array(
		'name'                  => 'Projekt',
		'singular_name'         => 'Projekt',
		'menu_name'             => 'Projekt',
		'name_admin_bar'        => 'Projekt',
		'archives'              => 'Projektarkiv',
		'attributes'            => '',
		'parent_item_colon'     => '',
		'all_items'             => 'Alla projekt',
		'add_new_item'          => 'Lägg till nytt projekt',
		'add_new'               => 'Lägg till nytt projekt',
		'new_item'              => 'Nytt projekt',
		'edit_item'             => 'Redigera projekt',
		'update_item'           => 'Uppdatera projekt',
		'view_item'             => 'Se projekt',
		'view_items'            => 'Se projekten',
		'search_items'          => 'Sök bland projekt',
		'not_found'             => 'Inget funnet',
		'not_found_in_trash'    => 'Inget funnet i papperskorgen',
		'featured_image'        => 'Listningsbild',
		'set_featured_image'    => 'Bestäm listningsbild',
		'remove_featured_image' => 'Ta bort listningsbild',
		'use_featured_image'    => 'Använd som listningsbild',
		'insert_into_item'      => 'Insert into item',
		'uploaded_to_this_item' => 'Uploaded to this item',
		'items_list'            => 'Projektlistning',
		'items_list_navigation' => 'Navigera projektlista',
		'filter_items_list'     => 'Filtrera projektlista',
	);
	$args = array(
		'label'                 => 'Projekt',
		'description'           => 'Post Type Description',
		'labels'                => $labels,
		'supports'              => array( 'title', 'excerpt', ),
		'taxonomies'            => array( 'leverabler' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-media-document',
		'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( 'cpt_projekt', $args );

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

}