Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. catalog/category/subcategory/productname
  2.  
  3. catalog
  4.  
  5. catalog
  6.  
  7. add_filter( 'rewrite_rules_array', function( $rules )
  8. {
  9. $new_rules = array(
  10. 'catalog/([^/]*?)/page/([0-9]{1,})/?$' => 'index.php?product_cat=$matches[1]&paged=$matches[2]',
  11. 'catalog/([^/]*?)/?$' => 'index.php?product_cat=$matches[1]',
  12. );
  13. return $new_rules + $rules;
  14. } );
  15.  
  16. catalog/category/subcategory/productname
  17.  
  18. product-cat/category/subcategory/productname
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement