Custom post type taxonomy URL changes
-
Hello huys,
I have a custom post type and in this custom post type I did setup taxonomy support. My code so far is like this:
function create_post_type() { register_post_type( 'CPT', array( 'labels' => array( 'name' => __( 'CPT' ), 'singular_name' => __( 'CPT' ) ), 'public' => true, 'has_archive' => true, 'menu_position'=>5, 'hierarchical' => true, 'rewrite' => true, 'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields' ), ) ); register_taxonomy( "CPT", array("CPT"), array("hierarchical" => true, "label" => "Category CPT", "singular_label" => "CPT" )); }The problem I have is when I check a category at a post in the custom post type, the post gets the category linked but the URL does’t change.
I want to use a filter posts by using a; order by category in the custom post type.
Anyone can tell me what I need to do to see the url structure like this:
http://www.sitename.com/cpt/category-name/post-nameI hope someone can help me with this issue since now there is no new URL created but in the menu I got a possibility to add:
http://www.sitename.com/cpt/post-name/category-nameBut this link will redirect to a 404page.
The topic ‘Custom post type taxonomy URL changes’ is closed to new replies.