Skip Navigation

[Resolved] Access fields of unrelated posts from within a view

This support ticket is created 6 years, 6 months ago. 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
- 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/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#578378

Hi there,

I have two unrelated post types: calendarday and record. I have a view that loops through a number of of the "calendarday" posts based on a date filter and displays them on my page. I have another view that displays posts from the type "record " that I have inserted into "Content Template for Calendarday". I want to filter the record display based on a field in the calendarday post in which the record post is being displayed. Eg the post-date.

I know that a field in a parent post type can be accessed using the id="$parent" shortcode attribute, but is there a way for a view to access a field in the post in which it appears if it is not related.

Thanks - Mark

#578415

Dear Mark,

In your case, you can try with "Controlling the Views filter with shortcode attributes", see our document:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes

For your reference

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