Skip Navigation

[Resuelto] using custom field in page url

This support ticket is created hace 6 años, 2 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Waqar hace 6 años, 2 meses.

Asistido por: Waqar.

Autor
Mensajes
#1119908

hi , for seo page url purpose, i need to append a custom field in the page url, is that possible ?

current url : site.com/post-type/ listing-name

prefer to have : site.com/post-type/custom-field-name/ listing-name

Pls advice the approach or if there is any ready sample to follow.

Thanks

#1120741

Hi there,

Thank you for contacting us and I'll be happy to assist.

As the permalinks and their rewriting are managed by the WordPress, this question is better suited for the WordPress forum.

You'll get the most accurate and up-to-date information about possible challenges and drawbacks in adopting this approach:
https://wordpress.org/support/forums/

In theory, this will involve two steps,

1. Updating the saved permalink, when the post is saved, based on the custom field value.
( ref: https://toolset.com/documentation/customizing-sites-using-php/updating-types-fields-using-php/ )

2. Rewriting the URL itself.

Here is a link to a similar support thread on the topic:
https://wordpress.stackexchange.com/questions/294011/change-permalinks-with-acf-values

Note: As no two posts can share the same permalink, you'll also need to add a check that no two custom field values are the same.

I hope this helps! Please let us know if there's anything else we can help you with.