Wordpress: Multiple subcategories, same slug?

by 4 replies
6
Does anyone know of any possible way to have multiple subcategories with the same slug?

For example:

Main Category: Guitar (www.music.com/guitar/)
Sub: Learning To Play (www.music.com/guitar/learning/)
Sub: Lessons (www.music.com/guitar/lessons/)

Main Category: Violin (www.music.com/violin/)
Sub: Learning To Play (www.music.com/violin/learning/)
Sub: Lessons (www.music.com/violin/lessons/)

Now, Wordpress will not allow the second set of "violin" subcats and will instead default them to "learning-2" and "violin-2" which is pretty ugly.

Does anyone know of a working hack/method to allow for duplicate slugs for subcategories? With a non-Wordpress site this would be trivial, but I don't understand why Wordpress doesn't make accommodations for this, as it's kind of important for logical and user-friendly website structure.
#website design #multiple #slug #subcategories #wordpress
  • I'd say, use a non-WP site then.

    WP's taxonomy is set up in that way: every term's ID and slug must be unique (click the link to read the details).
  • i think it will work but you need to define your custom URL's, its more complex but it will work. I have something setup like that in one of my themes that i sell on my site.
    • [1] reply
    • There is a huge difference between guessing (what you do: i think) - and between knowing the facts.

      The OP stated based on his trial that it did NOT work.
      I seconded that and gave the link to the explanation WHY it doesn't work.

      Now you come and post vague guesses based on nothing... Show me exactly where you have 2 subcategories with the exact same slug in a WP installation!
  • Yeah, it definitely is not possible with a default WP install. However, I was wondering if there was a way to hack WP or a plugin that would make it possible. Even some kind of mod_rewrite witchery would work, I suppose.

Next Topics on Trending Feed