Saltar navegación

[Cerrado] Change URL structure

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Nigel 1 year, 8 months ago.

Autor
Mensajes
#2745627

Hello,

I have custom post type and custom taxonomy for that CPT. My url is now domain.com/cpt-slug/post-slug

I need to change URL to domain.com/cpt-slug/custom-taxonomy-slug/post-slug

Can you help how to do that?

#2745638

Nigel
Colaborador

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+01:00)

Hi there

Such a permalink structure isn't possible with the normal settings available when registering a post type (whether you register the post type using Toolset, or directly using the WordPress function register_post_type).

For structure you would need to set up custom rewrite rules. That involves using add_rewrite_rule to register the custom rules, and using the filter post_type_link to modify the post URLs.

See

https://developer.wordpress.org/reference/hooks/post_type_link/
https://developer.wordpress.org/reference/functions/add_rewrite_rule/

If you Google, you'll find there are lots of tutorials about creating custom rewrite rules.

El debate ‘[Cerrado] Change URL structure’ está cerrado y no admite más respuestas.