Im trying to create a permalink structure like this:

Desired permalink structure

  • domain.com/country/city/hotels/postname/
  • domain.com/country/city/restaurants/postname/

Desired breadcrumbs

  • Country > City > Hotels > Hotelname
  • Country > City > Restaurant > Restaurantname

I was thinking of making hotels and restaurants a custom post type and add custom taxonomies for the country and city, but i dont seem to be able to put the taxonomies in front of the custom post type in the URL. Is there any workaround for this? Or am i just doing it the wrong way?

Thanks in advance

  • it's possible, but tricky with URLs that start with variable elements, as the rules that get generated clash with the built in page and date rules. It would be easier with URLs like domain.com/hotels/country/city/postname/ – Milo Apr 7 '18 at 4:36
  • Thanks for your answer Milo. Your suggested structure is what i have running right now, but since everything is connected to the countries/cities it seems much more logical to have those in front of the cpt. If it helps, i only use 7 countries so it must be doable to detect wether the first segment is one of those and build the rest from there. – Tony Apr 7 '18 at 13:41

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.