Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Solafrica – CPT – Story

if ( ! function_exists('sola_cpt_stories') ) {

// Register Custom Post Type
function sola_cpt_stories() {

	$labels = array(
		'name'                  => _x( 'Stories', 'Post Type General Name', 'sola_text_domain' ),
		'singular_name'         => _x( 'Story', 'Post Type Singular Name', 'sola_text_domain' ),
		'menu_name'             => __( 'Stories', 'sola_text_domain' ),
		'name_admin_bar'        => __( 'Story', 'sola_text_domain' ),
		'archives'              => __( 'Story-Archiv', 'sola_text_domain' ),
		'attributes'            => __( 'Story-Attribute', 'sola_text_domain' ),
		'parent_item_colon'     => __( 'Übergeordnete Story', 'sola_text_domain' ),
		'all_items'             => __( 'Alle Stories', 'sola_text_domain' ),
		'add_new_item'          => __( 'Neue Story hinzufügen', 'sola_text_domain' ),
		'add_new'               => __( 'Neue Story hinzufügen', 'sola_text_domain' ),
		'new_item'              => __( 'Neue Story', 'sola_text_domain' ),
		'edit_item'             => __( 'Story bearbeiten', 'sola_text_domain' ),
		'update_item'           => __( 'Story aktualisieren', 'sola_text_domain' ),
		'view_item'             => __( 'Story ansehen', 'sola_text_domain' ),
		'view_items'            => __( 'Stories ansehen', 'sola_text_domain' ),
		'search_items'          => __( 'Stories durchsuchen', 'sola_text_domain' ),
		'not_found'             => __( 'Nicht gefunden', 'sola_text_domain' ),
		'not_found_in_trash'    => __( 'Nichts im Papierkorb gefunden', 'sola_text_domain' ),
		'featured_image'        => __( 'Hervorgehobenes Story-Bild', 'sola_text_domain' ),
		'set_featured_image'    => __( 'Story-Bild festlegen', 'sola_text_domain' ),
		'remove_featured_image' => __( 'Story-Bild entfernen', 'sola_text_domain' ),
		'use_featured_image'    => __( 'Als hervorgehobenes Story-Bild nutzen', 'sola_text_domain' ),
		'insert_into_item'      => __( 'Zur Story hinzufügen', 'sola_text_domain' ),
		'uploaded_to_this_item' => __( 'Zu dieser Story hochgeladen', 'sola_text_domain' ),
		'items_list'            => __( 'Story-Liste', 'sola_text_domain' ),
		'items_list_navigation' => __( 'Story-Liste-Navigation', 'sola_text_domain' ),
		'filter_items_list'     => __( 'Story-Liste filtern', 'sola_text_domain' ),
	);
	$args = array(
		'label'                 => __( 'Story', 'sola_text_domain' ),
		'description'           => __( 'Post Type Description', 'sola_text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'revisions', 'custom-fields' ),
		'taxonomies'            => array( 'projektland' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-format-quote',
		'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',
		'show_in_rest'          => true,
	);
	register_post_type( 'stories', $args );

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

}