Custom Post Type and custom taxonomies URL
-
I’m totaly new with Custom Post Type and Custom Taxonomies.
I’m not new to wordpress, but after not really working with it the last 2 years, it is like a new jump in, so please forgive me if I’m stupid
I have no problem to create a custom post type called ‘portfolio’
I have no problem to create a custom taxonomy called ‘portfolioJobTypes’ which is linked to portfolio and has values ‘web’ and ‘print’
register_taxonomy( 'portfolioJobTypes', array('portfolio'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */ array('hierarchical' => true, /* if this is true it acts like categories */ 'labels' => array( 'name' => __( 'Job Types', 'grd2012' ), /* name of the custom taxonomy */ 'singular_name' => __( 'Job Type', 'grd2012' ), /* single taxonomy name */ 'search_items' => __( 'Search JobTypes', 'grd2012' ), /* search title for taxomony */ 'all_items' => __( 'All Job Types', 'grd2012' ), /* all title for taxonomies */ 'parent_item' => __( 'Parent Job Types', 'grd2012' ), /* parent title for taxonomy */ 'parent_item_colon' => __( 'Parent Job Type:', 'grd2012' ), /* parent taxonomy title */ 'edit_item' => __( 'Edit Job Type', 'grd2012' ), /* edit custom taxonomy title */ 'update_item' => __( 'Update Job Type', 'grd2012' ), /* update title for taxonomy */ 'add_new_item' => __( 'Add Job Type', 'grd2012' ), /* add new title for taxonomy */ 'new_item_name' => __( 'New Job Type', 'grd2012' ) /* name title for taxonomy */ ), 'show_ui' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'portfolio/type'), ) );
I use rewrite’ => array( ‘slug’ => ‘portfolio/type’) so that I’m sure all posts using the portfolioJobTypes taxonomy will have a url of portfolio/type (**is that correct?**)
actually I have managed to create several custom taxonomies linked to portfolio
I have not problem to have CPT archive page at
I have no problem to have the the detail page
I have no problem to have an Term of a taxonomy archive
https://portfolio.newdawnmedialtd.com/portfolio/type/web/**but** I face problem to have an archive of the taxonomies
something likehttps://portfolio.newdawnmedialtd.com/portfolio/type/
returns me a 404
I have flushed to permalink page on the admin
I wish to use the generic taxonomy.php like I use for the terms of a taxonomy (by the way if you have Custom Structure to advise, I’m a taker)
any idea where I’m wrong for this taxonomy archive?
Thank you in advance
Steffy
- The topic ‘Custom Post Type and custom taxonomies URL’ is closed to new replies.