I’m really excited about the custom post type together with custom taxonomies. Still, having problems having the features play well together. Maybe someone can explain what I’m missing.
Through my plugin, I’m creating up custom post type “Products”. A product should be in a product-category, so after that a taxonomy is registered.
Once all this is done and a new product is added, I add a category from the “product’s” edit screen and check to have the product in this new category. This should, afaik, result in a permalink like “mysite/new-productcategory/product”.
This already works perfect with “normal” posts and changing their categories & that is were I get my logic from.
But the custom post (=product) remains in a default “product” cat.
My permalink structure is /%category%/%postname%/ (as anything else kept resulting in 404s after enabling the plugin).
My plugin’s code is:
/*custom post type*/
'label' => __('Products'),
'singular_label' => __('Product'),
'public' => true,
'show_ui' => true, // UI in admin panel
'_builtin' => false, // It's a custom post type, not built in!
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
'hierarchical' => false,
'supports' => array('title', 'excerpt', 'editor', 'thumbnail')
register_taxonomy( 'product-cats', 'products', array(
'hierarchical' => true,
'label' => __('Product-Category'),
'query_var' => true,
'rewrite' => true)
Can someone please explain what could be changed to make the permalink structure work as described above? Thanks!