My custom taxonomy is created already by hand with no plug in
add_action('init', 'my_custom_init');
function my_custom_init() {
$labels = array(
// You can alter the text on any of these
'name' => _x('Pharmacie', 'post type general name'),
'singular_name' => _x('Item', 'post type singular name'),
'add_new' => _x('Add Item', 'Event Item'),
'add_new_item' => __('Add New Item'),
'edit_item' => __('Edit Item'),
'new_item' => __('New Item'),
'view_item' => __('View Item Details'),
'search_items' => __('Search Pharmacie Items'),
'not_found' => __('Element non trouve'),
'not_found_in_trash' => __('No portfolio items found in the Trash with that criteria'),
'view' => __('Voir Item')
);
$args = array(
'labels' => $labels,
// We can give our post type a description in case we forget what its for
'description' => 'This is the holding location for all pharmacie items',
'public' => true,
'publicly_queryable' => true,
// To keep in the search, or to not keep in the search. That is the question.
'exclude_from_search' => true,
'show_ui' => true,
'rewrite' => true,
'hierarchical' => true,
'menu_position' => 5,
'supports' => array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions')
);
register_post_type('pharmacie',$args);
}
// Register References taxonomy
$labels = array(
'name' => _x( 'References', 'taxonomy general name' ),
'singular_name' => _x( 'Reference', 'taxonomy singular name' ),
'search_items' => __( 'Search references' ),
'popular_items' => __( 'References' ),
'all_items' => __( 'Tous' ),
'parent_item' => __( 'Parent References' ),
'parent_item_colon' => __( 'Parent reference:' ),
'edit_item' => __( 'Editer References' ),
'update_item' => __( 'Mettre a jour' ),
'add_new_item' => __( 'Ajouter nouvelle reference' ),
'new_item_name' => __( 'New reference Name' )
);
register_taxonomy('xyz',array('pharmacie'), array(
// Make sure you set hierarchical to true
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
// You can rename the slug to whatever you like, just make sure its unique
// Make sure you remember what it was because you'll need it later
'rewrite' => array( 'slug' => 'xyz' )
));