Created
September 20, 2013 15:36
-
-
Save BFTrick/6639414 to your computer and use it in GitHub Desktop.
Make the product category permalinks non hierarchical. So instead of `shop/clothing/t-shirt/` we'll see `shop/t-shirt/`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// make the categories non hierarchical for their permalinks | |
function my_woocommerce_taxonomy_args_product_cat( $args ) { | |
$args['rewrite']['hierarchical'] = false; | |
return $args; | |
} | |
add_filter( 'woocommerce_taxonomy_args_product_cat', 'my_woocommerce_taxonomy_args_product_cat' ); |
Hey, does anyone know how to add a filter to include blog posts and pages? So that this setting works globally across wordpress?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this a code that need to be added in functions.php ?
My goals:
It would be much better If I can just use categories and sub categories only for the url and then the permalink from wordpress.
Produkt = Product ; Etiketi = Tags