Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Portfolio Item Attributes taxonomy

Taxonomy to go with my generated Portfolio Items CPT: https://generatewp.com/snippet/37gmbkr/

if ( ! function_exists( 'portfolio_taxonomy' ) ) {

// Register Custom Taxonomy
function portfolio_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Portfolio Attributes', 'Taxonomy General Name', 'wp_examples' ),
		'singular_name'              => _x( 'Portfolio Attribute', 'Taxonomy Singular Name', 'wp_examples' ),
		'menu_name'                  => __( 'Item Attributes', 'wp_examples' ),
		'all_items'                  => __( 'All Portfolio Item Attributes', 'wp_examples' ),
		'parent_item'                => __( 'Parent Attribute', 'wp_examples' ),
		'parent_item_colon'          => __( 'Parent Attribute:', 'wp_examples' ),
		'new_item_name'              => __( 'New Item Attribute', 'wp_examples' ),
		'add_new_item'               => __( 'Add New Item Attribute', 'wp_examples' ),
		'edit_item'                  => __( 'Edit Item Attribute', 'wp_examples' ),
		'update_item'                => __( 'Update Item Attribute', 'wp_examples' ),
		'view_item'                  => __( 'View Item Attribute', 'wp_examples' ),
		'separate_items_with_commas' => __( 'Separate Portfolio Item Attributes with commas', 'wp_examples' ),
		'add_or_remove_items'        => __( 'Add or remove portfolio item attributes', 'wp_examples' ),
		'choose_from_most_used'      => __( 'Choose from the most used Portfolio Item Atrributes', 'wp_examples' ),
		'popular_items'              => __( 'Popular Portfolio Item Attributes', 'wp_examples' ),
		'search_items'               => __( 'Search Portfolio Item Attributes', 'wp_examples' ),
		'not_found'                  => __( 'Not Found', 'wp_examples' ),
		'no_terms'                   => __( 'No items', 'wp_examples' ),
		'items_list'                 => __( 'Portfolio Item Attributes list', 'wp_examples' ),
		'items_list_navigation'      => __( 'Portfolio Item Attributes list navigation', 'wp_examples' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => false,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'portfolio_atts', array( 'portfolio_items' ), $args );

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

}