Skip Navigation

[Resolved] Display Post ID of related post

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
- 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)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 1 year, 10 months ago.

Assisted by: Waqar.


In a View for a custom post type, my view loop displays fields from the related posts using those related fields from the Fields and Views interface. I want to add a CSS id containing the Post ID of the related post being displayed, but there is no button for Post ID within the post type I'm displaying. How do I display the current, related Post ID in a View loop?



Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)



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

In the Fields and Views interface, you'll see the option to insert the "Post ID", in the standard WordPress fields.
( example screenshot: post-ID-fields-and-text.png )

From the next screen, you can also select the source of the relationship post type, to use for that ID.
( example screenshot: post-ID-relationship-selection.png )

That interface will add the "wpv-post-id" shortcode (ref: for the post ID with the item attribute ( ref: ) and you can also add the shortcode directly, for example:

[wpv-post-id item="@post-book.parent"]

In this example, the "post-book" is the relationship's slug and the "parent" part tells that the target post type is the parent in the relationship.

I hope this helps and please let me know if you need any further assistance around this.


This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.