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?
Minesh
Supporter
Languages:
English (English )
Timezone:
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
Resolved with ticket #1953005
"Code Snippet to get parent post ID"
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
You are welcome to mark this ticket resolve as well.
My issue is resolved now. Thank you!