0

I registered a post type of 'product', and also registered a taxonomy 'poruct-cats' for this post type.

When I want to access to product-cats it seems like below:

example.com/poruct-cats/a-product-name

The above url is not seo friendly.

I Like the url be like below:

example.com/product/poruct-cats/a-product-name

I spent lots of time for reading about WordPress rewrite in codex but I finally could not do that.

Any suggestions is appreciated.

0

1 Answer 1

0

Just use the following rewrite argument in your register_taxonomy() call:

register_taxonomy( 'product_cat', 'product', array(
    'rewrite' => array(
        'with_front' => false,
        'slug' => 'product/poruct-cats',
    ),

    // Other arguments
));

Not the answer you're looking for? Browse other questions tagged or ask your own question.