Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Servizi / Trattamenti

if ( ! function_exists('services_post_type') ) {

// Register Custom Post Type
function services_post_type() {

	$labels = array(
		'name'                  => _x( 'Trattamenti', 'Post Type General Name', 'mc_services' ),
		'singular_name'         => _x( 'Trattamento', 'Post Type Singular Name', 'mc_services' ),
		'menu_name'             => __( 'Trattamenti', 'mc_services' ),
		'name_admin_bar'        => __( 'Trattamenti', 'mc_services' ),
		'archives'              => __( 'Archivio Trattamenti', 'mc_services' ),
		'attributes'            => __( 'Attributi', 'mc_services' ),
		'parent_item_colon'     => __( 'Genitore', 'mc_services' ),
		'all_items'             => __( 'Tutti i trattamenti', 'mc_services' ),
		'add_new_item'          => __( 'Nuovo', 'mc_services' ),
		'add_new'               => __( 'Nuovo', 'mc_services' ),
		'new_item'              => __( 'Nuovo', 'mc_services' ),
		'edit_item'             => __( 'Modifica', 'mc_services' ),
		'update_item'           => __( 'Aggiorna', 'mc_services' ),
		'view_item'             => __( 'Visualizza', 'mc_services' ),
		'view_items'            => __( 'Visualizza trattamenti', 'mc_services' ),
		'search_items'          => __( 'Cerca trattamento', 'mc_services' ),
		'not_found'             => __( 'Non trovato', 'mc_services' ),
		'not_found_in_trash'    => __( 'Non trovato nel carrello', 'mc_services' ),
		'featured_image'        => __( 'Immagine Principale', 'mc_services' ),
		'set_featured_image'    => __( 'Imposta immagine', 'mc_services' ),
		'remove_featured_image' => __( 'Rimuove immagine', 'mc_services' ),
		'use_featured_image'    => __( 'Usa come immagine principale', 'mc_services' ),
		'insert_into_item'      => __( 'Inserisci', 'mc_services' ),
		'uploaded_to_this_item' => __( 'Carica', 'mc_services' ),
		'items_list'            => __( 'Lista trattamenti', 'mc_services' ),
		'items_list_navigation' => __( 'Navigazione trattamenti', 'mc_services' ),
		'filter_items_list'     => __( 'Filtra lista trattamenti', 'mc_services' ),
	);
	$rewrite = array(
		'slug'                  => 'trattamenti',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'Trattamento', 'mc_services' ),
		'description'           => __( 'Post Type Description', 'mc_services' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes' ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 20,
		'menu_icon'             => 'dashicons-image-filter',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => false,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'query_var'             => 'services',
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
		'show_in_rest'          => false,
	);
	register_post_type( 'mc_services', $args );

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

}