Problem:
There is a one-to-many relationship between Author and Essay; Author is the parent post of Essay. The Author CPT has a field named Person Type. Person Type has a couple possible values: student, faculty, and alumni.
I am trying to use a View to display a list of Essay posts whose Authors are alumni.Is this possible?
Solution:
Unfortunately, there isn't such a built-in feature within Views plugin, Views is using WordPress class WP_Query to query the posts, if you are querying "Essay" posts, Views can only filter the view by custom fields of "Essay" posts, it can not filter by fields of other post type, this is a limitation of WordPress.
Currently, I suggest you use [wpv-conditional] shortcode to check field "Person Type" value of related "Author" post, if the value is "alumni", then display the "Essay" post.
Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
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 4 replies, has 2 voices.
Last updated by 6 years, 6 months ago.
Assisted by: Luo Yang.