Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

RHR_cpt_lofts

Lofts

if ( ! function_exists('cpt_loft') ) {

// Register Custom Post Type
function cpt_loft() {

	$labels = array(
		'name'                  => _x( 'Lofts', 'Post Type General Name', 'rohrerhof' ),
		'singular_name'         => _x( 'Loft', 'Post Type Singular Name', 'rohrerhof' ),
		'menu_name'             => __( 'Lofts', 'rohrerhof' ),
		'name_admin_bar'        => __( 'Lofts', 'rohrerhof' ),
		'archives'              => __( 'Loft Liste', 'rohrerhof' ),
		'attributes'            => __( 'Loft Eigenschaften', 'rohrerhof' ),
		'parent_item_colon'     => __( 'Parent Item:', 'rohrerhof' ),
		'all_items'             => __( 'Alle Lofts', 'rohrerhof' ),
		'add_new_item'          => __( 'Neues Loft hinzufügen:', 'rohrerhof' ),
		'add_new'               => __( 'Neues Loft', 'rohrerhof' ),
		'new_item'              => __( 'Neues Loft', 'rohrerhof' ),
		'edit_item'             => __( 'Loft bearbeiten', 'rohrerhof' ),
		'update_item'           => __( 'Loft aktualisieren', 'rohrerhof' ),
		'view_item'             => __( 'Loft ansehen', 'rohrerhof' ),
		'view_items'            => __( 'Lofts ansehen', 'rohrerhof' ),
		'search_items'          => __( 'Lofts durchsuchen', 'rohrerhof' ),
		'not_found'             => __( 'Nicht gefunden', 'rohrerhof' ),
		'not_found_in_trash'    => __( 'Nicht im Papierkorb gefunden', 'rohrerhof' ),
		'featured_image'        => __( 'Loft-Vorschaubild', 'rohrerhof' ),
		'set_featured_image'    => __( 'Vorschaubild speichern', 'rohrerhof' ),
		'remove_featured_image' => __( 'Vorschaubild entfernen', 'rohrerhof' ),
		'use_featured_image'    => __( 'Als Vorschau verwenden', 'rohrerhof' ),
		'insert_into_item'      => __( 'In das Loft einfügen', 'rohrerhof' ),
		'uploaded_to_this_item' => __( 'zu diesem Loft hochgeladen', 'rohrerhof' ),
		'items_list'            => __( 'Liste der Lofts', 'rohrerhof' ),
		'items_list_navigation' => __( 'Listennavigation', 'rohrerhof' ),
		'filter_items_list'     => __( 'Loftlistenfiltern', 'rohrerhof' ),
	);
	$args = array(
		'label'                 => __( 'Loft', 'rohrerhof' ),
		'description'           => __( 'Lofts im Rohrerhof', 'rohrerhof' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail' ),
		'taxonomies'            => array( 'tax_lage', 'tax_status' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-admin-home',
		'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( 'loft', $args );

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

}