wordpress custom taxonomy register
function sonia_taxonomy() {
register_taxonomy(
'portfolio_cat', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
'portfolio-items', //post type name
array(
'hierarchical' => true,
'label' => 'Portfolio Category', //Display name
'query_var' => true,
'rewrite' => array(
'slug' => 'portfolio-category', // This controls the base slug that will display before each term
'with_front' => true // Don't display the category base before
)
)
);
}
add_action( 'init', 'sonia_taxonomy');