Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Created September 20, 2013 15:36
Show Gist options
  • Save BFTrick/6639414 to your computer and use it in GitHub Desktop.
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/`
@stanimirmihov
Copy link

Is this a code that need to be added in functions.php ?

My goals:

  1. When add new product it adds automaticly produkt (product) to the url - https://stanimirmihov.com/produkt/staven-kompleks-stavi-suhojiliq/ . Can I use instead category or tag every time instead this default line?
  2. Same with categories, when I browse otslabvane (weight loss) I have automaticly added text to the URL - https://stanimirmihov.com/produkt-kategoriya/otslabvane/ , Can't I just use https://stanimirmihov.com/the name of the category ?
  3. Same with the tags, when I browse tag otslabvane (weight loss) I have automaticly added text to the URL - https://stanimirmihov.com/produkt-etiketi/otslabvane

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

@thepigeonoftime
Copy link

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