Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

categoria productos

if ( ! function_exists( 'lmdgh_categoria_producto_taxonomy' ) ) {

// Register Custom Taxonomy
function lmdgh_categoria_producto_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Categorías de productos', 'Taxonomy General Name', 'lmdgh' ),
		'singular_name'              => _x( 'Categoría de producto', 'Taxonomy Singular Name', 'lmdgh' ),
		'menu_name'                  => __( 'Categoría sde productos', 'lmdgh' ),
		'all_items'                  => __( 'Todas', 'lmdgh' ),
		'parent_item'                => __( 'Superior', 'lmdgh' ),
		'parent_item_colon'          => __( 'Superior:', 'lmdgh' ),
		'new_item_name'              => __( 'Nueva categoría', 'lmdgh' ),
		'add_new_item'               => __( 'Agregar nueva categoria', 'lmdgh' ),
		'edit_item'                  => __( 'Editar nueva categoria', 'lmdgh' ),
		'update_item'                => __( 'Actualizar categoria', 'lmdgh' ),
		'separate_items_with_commas' => __( 'Separar categorías con comas', 'lmdgh' ),
		'search_items'               => __( 'Buscar categoria', 'lmdgh' ),
		'add_or_remove_items'        => __( 'Agregar o eliminar categoria', 'lmdgh' ),
		'choose_from_most_used'      => __( 'Elegir entre las más usadas', 'lmdgh' ),
		'not_found'                  => __( 'No encontradas', 'lmdgh' ),
	);
	$rewrite = array(
		'slug'                       => 'familia_productos',
		'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'              => false,
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'categorias_producto', array( 'post' ), $args );

}

// Hook into the 'init' action
add_action( 'init', 'lmdgh_categoria_producto_taxonomy', 0 );

}