Skip Navigation

[Resuelto] Removing CPT slug makes child pages not work

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

The issue here is that the user has an inbuilt hierarchical post relationship and wanted to remove the parent slug from the posts.

Solution:

This was resolved by using the following .
https://wordpress.org/plugins/permalink-manager/

This support ticket is created hace 5 años, 9 meses. There's a good chance that you are reading advice that it now obsolete.

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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: 

Este tema contiene 5 respuestas, tiene 2 mensajes.

Última actualización por Bob Dowdy hace 5 años, 9 meses.

Asistido por: Shane.

Autor
Mensajes
#1202756

Hello,

I know this is probably outside the realm of your support, but I'm really hoping you can help me.

Using the PHP code I found here (enlace oculto) I have removed the slug for my CPT called "office". So now /office/name-of-office/ becomes /name-of-office/

The issue I am running into is I can't get the child pages of /name-of-office/ to load (404 or WordPress redirects it to some similarly named page). I have tried every snippet of PHP that you all have linked to in previous support forums, as well as everything I can find on stack overflow.

This site I'm working on has both listings and sold items nested as child pages under each office, so /name-of-office/listings and /name-of-office/listings/sold/

Thanks in advance,
Corey

#1203380

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Bob,

Thank you for contacting our support forum.

Actually I would recommend seeking help from our registered contractors with this as I know that child posts usually require the parent in the url.

These child posts are of the same post type correct and not a different CPT?

Please let me know.
Thanks,
Shane

#1203480

Yes, these are the same CPT.

I am not Bob actually, I'm a developer working on his project. Do you have an estimate for how much that would cost?

There are several freely provided solutions for this online, but none work.

#1204104

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi,

I believe you are getting this issue because the child post permalink is saved with the parent post in it.

Take a look here .
enlace oculto

This archive might assist with getting the parent name removed from the permalink to allow it to start working again.

Please let me know if this helps.
Thanks,
Shane

#1208026

Thanks Shane,

That plugin pointed me in the right direction, and I found the perfect plugin to fit my needs. It allows for permastructures that kick in automatically when a specific CT is saved/updated:

https://wordpress.org/plugins/permalink-manager/

My issue is resolved.

Best,
Corey

#1208027

My issue is resolved now. Thank you!