0

I have a custom taxonomy named 'location'. Where country and city of country is listed as parent child relation.

Suppose India is location taxonomy while Delhi and Mumbai are also location taxonomy under India

Post have selected relevant city along with country taxonomy already.

So for an example: Post 1 has Delhi & India taxonomy selected, while Post 2 has Mimbai & India taxonomy selected while publishing.

Now what I am trying to do is: to have following URLs.

  1. domain.com/India/
  2. domain.com/India/Delhi/
  3. domain.com/India/Mumbai/

Where first URL should display all the post from India, Delhi & Mumbai. While second URL should display post only from Delhi and same for Mumbai

  • Well this how hierarchical taxonomy URLs already work, you just need to have some sort of indication of what taxonomy it is, eg. /location/india/delhi/. Otherwise WordPress doesn't know whether to look for a page or a taxonomy term. Is this what you're problem is? – Jacob Peattie Feb 16 '18 at 15:24
  • Hi, thanks for your reply. However I dont want to mentions /location (taxonomy name) to url only /india/delhi/ should be there. Also I have multiple countries each with their major cities. – SD. Feb 17 '18 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.