I am using woocommerce with Auto Rent theme found here.
I updated my product permalink using woocommerce permalinks from
xyz/product/product-name
to
xyz/cars/%product_cat%/product-name.
But this change is not being reflected in the website. It is still following the older link structure. I tried this with localhost as well as cpanel. Still no changes on permalink structure.
Link to my website: carrental.webception.in
Update: Check the screenshot below.
I am using woocommerce with Auto Rent theme found here.
I updated my product permalink using woocommerce permalinks from
xyz/product/product-name
to
xyz/cars/%product_cat%/product-name.
But this change is not being reflected in the website. It is still following the older link structure. I tried this with localhost as well as cpanel. Still no changes on permalink structure.
Link to my website: carrental.webception.in
Update: Check the screenshot below.
Share Improve this question edited Oct 24, 2016 at 4:43 Vishwasa Navada K asked Oct 24, 2016 at 4:19 Vishwasa Navada KVishwasa Navada K 1115 bronze badges 7 | Show 2 more comments1 Answer
Reset to default 1Add this code to your functions.php
-
add_action( 'init', 'the_drmatist_category_base' );
function the_drmatist_category_base() {
// Remember to flush the rules once manually after you added this code!
add_rewrite_rule(
// The regex to match the incoming URL
'news/([^/]+)/([^/]+)/([^/][^f][^e][^e][^d]+)(/[0-9]+)?/?$', //here my changes to exclude 'feed'
// The resulting internal URL
'index.php?product_cat=$matches[1]/$matches[2]&name=$matches[3]&paged=$matches[4]',
// Add the rule to the top of the rewrite list
'top' );
}
Then Save Changes on you Permalinks settings page and then try again please. And let me know what happens.
cat-type
– Vishwasa Navada K Commented Oct 24, 2016 at 5:03