Really hope someone can help me. I’m tearing my hair out right now.
I created a permalink in wordpress using rewrite rules
[Code moderated as per the Forum Rules. Please use the pastebin]
Everything was fine, until I made the fatal mistake of copying the ‘product’ template and saving it as the ‘shop’ template, forgetting to change the template name from ‘product’ to ‘shop’. When I switched to the shop template it made no difference, the page still directs to the product template.
If I navigate to http://my-site.com/shop – then the right shop template is displayed.
But if I navigate to http://my-site.com/shop/store-name/brand-name/product-name -it shows the product template
I’ve tried everything, I’ve disabled the cache plugin, deleted the page, deleted the template, removed the rule, changed the rule, deleted all references to the shop page in the interface, using the WordPress delete function and I even checked the database directly and all references were removed, yet when I use the ‘my-site/shop/store-name/brand-name/product-name’, the page is still being found.
I even tried changing:
$newrules[‘shop/([^/]+)/([^/]+)/([^/]+)?$’] = ‘index.php?pagename=product&shop_name=$matches&brand_name=$matches&product_name=$matches’;
$newrules[‘shop/([^/]+)/([^/]+)/([^/]+)?$’] = ‘index.php?pagename=product&shop=$matches&brand=$matches&product=$matches’;
and that made no difference.
I’ve searched high and wide for a solution and can’t find one. I want to be able to use the shop page, and don’t want to use another named page. Surely there must be a reference that can be deleted somewhere. Please can someone help…
Thanks in advance