Skip Navigation

[Résolu] Custom field in Permalink

This support ticket is created Il y a 5 années et 1 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Christian Cox Il y a 5 années et 1 mois.

Assisté par: Christian Cox.

Auteur
Publications
#1360763

Hello,

I would like to include custom field (e.g. my-field) in URL of my custom post type. So it would look like lien caché . How can I achieve this?

#1360943

Hi, Toolset doesn't provide this type of custom permalink structure. Our structures adhere to WordPress standards for custom posts, like post-type-slug/post-type. You would need a custom code solution here or a 3rd-party plugin to adjust the permalink structure to include a custom field. I will be glad to provide any Toolset-specific information you need to facilitate that implementation. I can show you how to get the value of a custom field from the database, for example:

types_render_field( "my-singlelinetext", array( ) );

Or using get_post_meta:

get_post_meta( 12345, "wpcf-my-singlelinetext", true); 

More information about the types_render_field API is available here: https://toolset.com/documentation/customizing-sites-using-php/functions/