I added some custom post types and custom taxonomies in my function.php and they work great. I assigned some hierarchical and non-hierarchical taxonomies (catagories & tags right?) to the custom post types. The non-hierarchical taxonomies work great and I can add new items in the tags metaboxes when editing the post. However, this does not work for my hierarchical taxonomies! I have no idea where the error lies, but the buttons "add new vehicle category" and "most used" do not work add all, you can click them but nothing loads. Is this something with javascript? here's an screenshot to show the metaboxes I'm talking about: Here's one of my registered custom post types:
$labels = array(
'name' => _x( 'Finished Projects', 'post type general name' ),
'singular_name' => _x( 'Finished Project', 'post type singular name' ),
'menu_name' => _x( 'Finished Projects', 'admin menu' ),
'name_admin_bar' => _x( 'Finished Project', 'add new on admin bar' ),
'add_new' => _x( 'Add New', 'Finished Project' ),
'add_new_item' => __( 'Add New Finished Project' ),
'new_item' => __( 'New Finished Project' ),
'edit_item' => __( 'Edit Finished Project' ),
'view_item' => __( 'View Finished Project' ),
'all_items' => __( 'All Finished Projects' ),
'search_items' => __( 'Search Finished Projects' ),
'parent_item_colon' => __( 'Parent Finished Projects:' ),
'not_found' => __( 'No Finished Projects found.' ),
'not_found_in_trash' => __( 'No Finished Projects found in Trash.' )
);
$args = array(
'labels' => $labels,
'description' => 'Page template for Finished Projects',
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'finished_projects' ),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('excerpt','comments','author'),
'taxonomies' => array('scales', 'manufacturers','product categories','vehicle categories','countries'),
);
register_post_type( 'finishedprojects', $args );
and here's one of my registered custom taxonomies:
//Vehicle Categories
$labels = array(
'name' => _x( 'Vehicles Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Vehicle Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Vehicles Categories' ),
'all_items' => __( 'All Vehicles Categories' ),
'parent_item' => __( 'Parent Vehicle Category' ),
'parent_item_colon' => __( 'Parent Vehicle Category:' ),
'edit_item' => __( 'Edit Vehicle Category' ),
'update_item' => __( 'Update Vehicle Category' ),
'add_new_item' => __( 'Add New Vehicle Category' ),
'new_item_name' => __( 'New Vehicle Category Name' ),
'menu_name' => __( 'Vehicle Categories' ),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'vehicle_categories' ),
);
register_taxonomy( 'vehicle category', array( 'reviews','finishedprojects' ), $args );
Do you guys need more info or is this enough information?
Thanks!
Remove the space from the name of the taxonomy.
To do this, replace:
register_taxonomy( 'vehicle category', array( 'reviews','finishedprojects' ), $args );
with:
register_taxonomy( 'vehicle_category', array( 'reviews','finishedprojects' ), $args );
Also, replace:
'taxonomies' => array('scales', 'manufacturers','product categories','vehicle categories','countries'),
with:
'taxonomies' => array('scales', 'manufacturers','product_categories','vehicle_categories','countries'),