// Create taxonomy for talk types
function nc_custom_taxonomies() {
// Add new "talktype" taxonomy to "talk" post type
register_taxonomy('talktype', 'talk', array(
'hierarchical' => true,
// This array of options controls the labels displayed in the WordPress Admin UI
'labels' => array(
'name' => _x( 'Talk Types', 'taxonomy general name' ),
'singular_name' => _x( 'Talk Type', 'taxonomy singular name' ),
'search_items' => __( 'Search Talk Types' ),
'all_items' => __( 'All Talk Types' ),
'parent_item' => __( 'Parent Talk Type' ),
'parent_item_colon' => __( 'Parent Talk Type:' ),
'edit_item' => __( 'Edit Talk Type' ),
'update_item' => __( 'Update Talk Type' ),
'add_new_item' => __( 'Add New Talk Type' ),
'new_item_name' => __( 'New Talk Type Name' ),
'menu_name' => __( 'Talk Types' ),
),
'query_var' => true,
// Control the slugs used for this taxonomy
'rewrite' => array(
'slug' => 'talktype',
'with_front' => false, // Don't display the category base before "/locations/"
'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
),
));
}
add_action( 'after_setup_theme', 'nc_custom_taxonomies', 0 );