Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Products

Produktkatalog

if ( ! function_exists('spega_custom_post_type') ) {

// Register Custom Post Type
function spega_custom_post_type() {

	$labels = array(
		'name'                  => _x( 'Produkte', 'Post Type General Name', 'spega_product_catalog' ),
		'singular_name'         => _x( 'Produkt', 'Post Type Singular Name', 'spega_product_catalog' ),
		'menu_name'             => __( 'Produkte', 'spega_product_catalog' ),
		'name_admin_bar'        => __( 'Produkte', 'spega_product_catalog' ),
		'archives'              => __( 'Produktarchiv', 'spega_product_catalog' ),
		'attributes'            => __( 'Produkt Attribute', 'spega_product_catalog' ),
		'parent_item_colon'     => __( 'Übergeordnetes Produkt:', 'spega_product_catalog' ),
		'all_items'             => __( 'Alle Produkte', 'spega_product_catalog' ),
		'add_new_item'          => __( 'Neues Produkt hinzufügen', 'spega_product_catalog' ),
		'add_new'               => __( 'Neues Produkt', 'spega_product_catalog' ),
		'new_item'              => __( 'Neues Produkt', 'spega_product_catalog' ),
		'edit_item'             => __( 'Produkt bearbeiten', 'spega_product_catalog' ),
		'update_item'           => __( 'Produkt aktualisieren', 'spega_product_catalog' ),
		'view_item'             => __( 'Produkt ansehen', 'spega_product_catalog' ),
		'view_items'            => __( 'Produkte Ansehen', 'spega_product_catalog' ),
		'search_items'          => __( 'Produkte durchsuchen', 'spega_product_catalog' ),
		'not_found'             => __( 'Nicht gefunden', 'spega_product_catalog' ),
		'not_found_in_trash'    => __( 'Nicht gefunden in Papierkorb', 'spega_product_catalog' ),
		'featured_image'        => __( 'Produktbild', 'spega_product_catalog' ),
		'set_featured_image'    => __( 'Produktbild setzen', 'spega_product_catalog' ),
		'remove_featured_image' => __( 'Produktbild entfernen', 'spega_product_catalog' ),
		'use_featured_image'    => __( 'Als Produktbild wählen', 'spega_product_catalog' ),
		'insert_into_item'      => __( 'In Produkt einfügen', 'spega_product_catalog' ),
		'uploaded_to_this_item' => __( 'Hinzugefügt zu diesem Produkt', 'spega_product_catalog' ),
		'items_list'            => __( 'Produktliste', 'spega_product_catalog' ),
		'items_list_navigation' => __( 'Produktliste Navigation', 'spega_product_catalog' ),
		'filter_items_list'     => __( 'Produktliste filtern', 'spega_product_catalog' ),
	);
	$args = array(
		'label'                 => __( 'Produkt', 'spega_product_catalog' ),
		'description'           => __( 'SPEGA Produkte', 'spega_product_catalog' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-cart',
		'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'       => 'post',
		'show_in_rest'          => true,
	);
	register_post_type( 'product_catalog', $args );

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

}