I have custom code in my child theme’s functions.php for www.AMDi.net that adds a custom taxonomy for Posts. What I really need is custom taxonomy for Portfolio, but when I switch the ‘post’ argument in this call: “register_taxonomy(‘Devices’,array(‘post’), array(…” it does not make a custom taxonomy under portfolio like I expect it too, nothing shows where I’d expect it to.
Is there something I’m missing because I’m scratching my head on this one?
Here’s the full snippet:
//hook into the init action and call create_book_taxonomies when it fires
add_action( ‘init’, ‘create_devices_hierarchical_taxonomy’, 0 );//create a custom taxonomy name it devices for your posts
function create_devices_hierarchical_taxonomy() {
// Add new taxonomy, make it hierarchical like categories
//first do the translations part for GUI$labels = array(
‘name’ => _x( ‘Devices’, ‘taxonomy general name’ ),
‘singular_name’ => _x( ‘Device’, ‘taxonomy singular name’ ),
‘search_items’ => __( ‘Search Devices’ ),
‘all_items’ => __( ‘All Devices’ ),
‘parent_item’ => __( ‘Parent Device’ ),
‘parent_item_colon’ => __( ‘Parent Device:’ ),
‘edit_item’ => __( ‘Edit Device’ ),
‘update_item’ => __( ‘Update Device’ ),
‘add_new_item’ => __( ‘Add New Device’ ),
‘new_item_name’ => __( ‘New Device Name’ ),
‘menu_name’ => __( ‘Devices’ ),
);// Now register the taxonomy
register_taxonomy(‘Devices’,array(‘post’), array(
‘hierarchical’ => true,
‘labels’ => $labels,
‘show_ui’ => true,
‘show_admin_column’ => true,
‘query_var’ => true,
‘rewrite’ => array( ‘slug’ => ‘Device’ ),
));}
