Sorry, I'm new to the site. Won't happen again.
After a little digging, I still no knowing what's wrong. I'm trying this piece of code on my functions.php:
function custom_rewrite( $wp_rewrite ) {
$feed_rules = array(
'product-category/(.+)/material/(.+)/color/(.+)' => 'index.php?product_cat='. $wp_rewrite->preg_index(1).'&pa_material='. $wp_rewrite->preg_index(2).'&pa_color='. $wp_rewrite->preg_index(3)
'product-category/(.+)/color/(.+)' => 'index.php?product_cat='. $wp_rewrite->preg_index(1).'&pa_color='. $wp_rewrite->preg_index(2)
'product-category/(.+)/material/(.+)' => 'index.php?product_cat='. $wp_rewrite->preg_index(1).'&pa_material='. $wp_rewrite->preg_index(2)
);
$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
}
// refresh/flush permalinks in the dashboard if this is changed in any way
add_filter( 'generate_rewrite_rules', 'custom_rewrite' );
Stil, my site won't load. This is what I get from debugging:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/marubdaz/public_html/www.site.com/wp-content/themes/builder/functions.php on line 6
Line 6 (part of the array):
'product-category/(.+)/color/(.+)' => 'index.php?product_cat='. $wp_rewrite->preg_index(1).'&pa_color='. $wp_rewrite->preg_index(2)
Any ideas? Thank you
---EDIT---
Problem solved. There were a couple of commas missing at the end of the array values :-/
Thanks