Malin revised this gist . Go to revision
1 file changed, 12 insertions
custom-rewrite-qrh.php(file created)
| @@ -0,0 +1,12 @@ | |||
| 1 | + | // force URL rewrite for QRh | |
| 2 | + | function custom_rewrite_rule() { | |
| 3 | + | // Adding a rewrite rule that maps the new URL to the internal query for product-category/outlet. | |
| 4 | + | add_rewrite_rule('^tienda/outlet/?$', 'index.php?product_cat=outlet', 'top'); | |
| 5 | + | } | |
| 6 | + | add_action('init', 'custom_rewrite_rule'); | |
| 7 | + | ||
| 8 | + | function custom_rewrite_tag() { | |
| 9 | + | // Adding the custom query var to ensure WordPress recognizes it. | |
| 10 | + | add_rewrite_tag('%product_cat%', '([^&]+)'); | |
| 11 | + | } | |
| 12 | + | add_action('init', 'custom_rewrite_tag'); | |
Newer
Older