Skip Navigation

[Résolu] Do post reference fields ONLY link to the title of another post type?

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

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Auteur
Publications
#1950579

I have two custom post types.
Clients
Vehicles

The Client table has a custom field "Client ID Number".

I want to use the post reference field type to connect each Vehicle to one of the the Clients.

But it "seems" like the post reference field can only be used to connect with the title of each Client post.

Am I missing something? It's not possible to use Post Reference fields to link to a custom field within a different post type?

Is this something that COULD be done with post relationships instead?

#1951417

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Post reference field is basically used to display single related post title.

I'm not sure if you want to access the parent field in this case. If yes, what if you try to add the following shortcode:

[types field='custom-field-slug' ' item='@post-reference-field-slug.parent'][/types]

Where:
- replace "custom-field-slug" with your original field slug which you want to display, in this case: "Client ID Number" field slug
- replace post-reference-field-slug with your post reference field slug

#1953661

Resolved with ticket #1953005

"Code Snippet to get parent post ID"

#1953663

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

You are welcome to mark this ticket resolve as well.

#1953667

My issue is resolved now. Thank you!