Wordpress: Multiple subcategories, same slug?

4 replies
  • WEB DESIGN
  • |
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.
#multiple #slug #subcategories #wordpress
  • Profile picture of the author Istvan Horvath
    Originally Posted by Matt Ward View Post

    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.
    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).
    Signature

    {{ DiscussionBoard.errors[5696403].message }}
  • Profile picture of the author andreisaioc
    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.
    {{ DiscussionBoard.errors[5696708].message }}
    • Profile picture of the author Istvan Horvath
      Originally Posted by andreisaioc View Post

      i think it will work ...
      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!
      Signature

      {{ DiscussionBoard.errors[5696942].message }}
  • Profile picture of the author Matt Ward
    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.
    Signature
    "Keep moving forward."
    {{ DiscussionBoard.errors[5697247].message }}

Trending Topics