Hi there,
I'm using the same archive template for both CPT and taxonomy.
CPT: distributori
taxonomy: regione
taxonomy terms: piemonte, abruzzo...
This is working fine except I get funny URLs:
domain/regione/piemonte -instead of-
domain/distributori/piemonte
How can I get my goal URL structure "domain/distributori/piemonte" that is domain/CPT/taxonomy-term?
Is there any documentation that you are following?
You want to change the permalinks for your taxonomy archive from
domain/taxonomy/term
to
domain/cpt-slug/term
correct?
That's not possible without a custom solution.
You can change the slug for the taxonomy archive in the settings when editing the taxonomy, but if you try to use the slug of a CPT you will see a warning notice (see screenshot), and I can confirm that trying to visit posts on the front end then fails.
Yes,
I don't understand, though. If taxonomies are children to CPTs, why don't URLs show this structure?
I would expect domain/CPT/taxonomy/taxonomy-term/CPT-name and not
domain/taxonomy/taxonomy-term totally skipping the CPT slug
Thank you
This how wordpress designs its permalink structures, for you to add your taxonomy term to the custom post type URL you will need to try using the plugin that Nigel mentioned in his response or use custom code to add the custom taxonomy to your permalink structure.
As Nigel also mentioned you will need to employ the use of the wordpress rewrite rules to create your custom URL structure.