My website has several product categories, for example:
- site.com/product-category/logs
- site.com/product-category/sheds
- site.com/product-category/wood
- site.com/product-category/local
With the last one, I also have a page for local products: site.com/local
I would like to replace the site.com/product-category/local link on my shop page with the site.com/local link. I have tried using the following filter in my functions.php, to no avail:
<?php
function replace_content($content) {
$content = str_replace('/product-category/local/', '/local/',$content);
return $content;
}
add_filter('the_content','replace_content');
Edit: my question is not about changing the URL structure of product category links, it is about including a non product category link in the loop of the categories page.