custom post and taxonomy custom url?
-
Hello
Below is the code that creates the custom post with taxonomy.add_action( 'init', 'product_post_type' ); function product_post_type(){ register_taxonomy('products', 'products', array('hierarchical' => true, 'label' => 'Product category', 'query_var' => true, 'rewrite' => array('hierarchical' => true ), ) ); register_post_type( 'product', array( 'labels' => array( 'name' => __( 'Products' ), 'singular_name' => 'product' , 'add_new_item' => 'Add new Product', 'edit_item' => 'Edit Product' ), 'taxonomies' => array('products'), 'supports' => array('title','editor','thumbnail'), 'public' => true, 'has_archive' => false, 'capability_type'=>'post' ) ); add_post_type_support( 'product', array( 'comments' ) ); }
Below is the url that shows the post in a taxonomy https://localhost/wordpress/product/project/ but I want to show the custom taxonomy the post belongs to in url so for example the project custom post has target category assigned so I want the url for project post is https://localhost/wordpress/products/target/project/ but it is currently https://localhost/wordpress/product/project/
Please help me.
Thanks
- The topic ‘custom post and taxonomy custom url?’ is closed to new replies.