Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Nova taxonomia Categoría per Vídeo Tutorials – Temàtica

Això és un snippet que crea una nova categoría anomenada «temàtica» pel CPT “Vídeo Tutorials”

if ( ! function_exists( 'tematica' ) ) {

// Register Custom Taxonomy
function tematica() {

	$labels = array(
		'name'                       => _x( 'Temàtiques', 'Taxonomy General Name', 'tematica' ),
		'singular_name'              => _x( 'Temàtica', 'Taxonomy Singular Name', 'tematica' ),
		'menu_name'                  => __( 'Temàtica', 'tematica' ),
		'all_items'                  => __( 'Totes les temàtiques', 'tematica' ),
		'parent_item'                => __( 'Temàtica pare', 'tematica' ),
		'parent_item_colon'          => __( 'Temàtica pare:', 'tematica' ),
		'new_item_name'              => __( 'Nou nom de temàtica', 'tematica' ),
		'add_new_item'               => __( 'Afegeix nova temàtica', 'tematica' ),
		'edit_item'                  => __( 'Edita la temàtica', 'tematica' ),
		'update_item'                => __( 'Edita la temàtica', 'tematica' ),
		'view_item'                  => __( 'Veu la temàtica', 'tematica' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'tematica' ),
		'add_or_remove_items'        => __( 'Add or remove items', 'tematica' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'tematica' ),
		'popular_items'              => __( 'Popular Items', 'tematica' ),
		'search_items'               => __( 'Search Items', 'tematica' ),
		'not_found'                  => __( 'Not Found', 'tematica' ),
		'no_terms'                   => __( 'No items', 'tematica' ),
		'items_list'                 => __( 'Items list', 'tematica' ),
		'items_list_navigation'      => __( 'Items list navigation', 'tematica' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'tematica', array( 'videotutorials' ), $args );

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

}