Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

TAX Prodotti

if ( ! function_exists( 'tax_products' ) ) {

// Register Custom Taxonomy
function tax_products() {

	$labels = array(
		'name'                       => _x( 'Categorie Prodotti', 'Taxonomy General Name', 'segfor' ),
		'singular_name'              => _x( 'Categoria Prodotto', 'Taxonomy Singular Name', 'segfor' ),
		'menu_name'                  => __( 'Categorie Prodotti', 'segfor' ),
		'all_items'                  => __( 'Tutti i Prodotti', 'segfor' ),
		'parent_item'                => __( 'Parente Prodotto', 'segfor' ),
		'parent_item_colon'          => __( 'Parente prodotto:', 'segfor' ),
		'new_item_name'              => __( 'Nuova categoria Prodotto', 'segfor' ),
		'add_new_item'               => __( 'Nuova Categoria Prodotto', 'segfor' ),
		'edit_item'                  => __( 'modifica categoria', 'segfor' ),
		'update_item'                => __( 'Aggiorna categoria', 'segfor' ),
		'view_item'                  => __( 'Vedi categoria', 'segfor' ),
		'separate_items_with_commas' => __( 'Separa le categoria con la virgola', 'segfor' ),
		'add_or_remove_items'        => __( 'Aggiungi o rimuovi categorie', 'segfor' ),
		'choose_from_most_used'      => __( 'Scegli tra quelle più usate', 'segfor' ),
		'popular_items'              => __( 'Categorie popolari', 'segfor' ),
		'search_items'               => __( 'Cerca categoria Prodotto', 'segfor' ),
		'not_found'                  => __( 'Non trovata', 'segfor' ),
		'no_terms'                   => __( 'Nessuna categoria', 'segfor' ),
		'items_list'                 => __( 'Lista categorie Prodotti', 'segfor' ),
		'items_list_navigation'      => __( 'Navigazione lista categorie', 'segfor' ),
	);
	$rewrite = array(
		'slug'                       => 'categoria',
		'with_front'                 => true,
		'hierarchical'               => false,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'query_var'                  => 'categoria-prodotti',
		'rewrite'                    => $rewrite,
		'show_in_rest'               => false,
	);
	register_taxonomy( 'tax_products', array( 'cpt_products' ), $args );

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

}