Tell us what you are trying to do?
I have a custom post type called departments, which is a hierarchical post type. I also have a custom post type called staff, which can be in a many to many relationship with departments. For example, Wilson Library is a parent department, and University Archives is a child department of Wilson Library.
I would like to create a view that shows staff members related to Wilson Library, as well as staff members related to one of its child departments.
Is there any documentation that you are following?
I was unable to locate documentation.
What is the link to your site?
Site is in development and not currently shareable.
Hi,
Thank you for contacting us and I'd be happy to assist.
To achieve this you'll need to use two views. One for cycling through the the target 'departments' posts and the other for showing their related 'staff' posts.
And since we'll need to nest the second view inside the first one, it will only be supported through the classic/legacy editor views.
If you haven't enabled them, please go to WP Admin > Toolset > Settings > General and select the option "Show both the legacy and Blocks interface and let me choose which to use for each item I build" for the "Editing Experience".
After that, you'll see the option to add classic views from WP Admin > Toolset > Views. You'll find the documentation on using the classic views at:
https://toolset.com/documentation/legacy-features/views-plugin/
I'll especially recommend going through the guides on filtering views by post IDs and nesting them:
https://toolset.com/documentation/legacy-features/views-plugin/filtering-views-query-by-post-id/#value-set-by-view-shortcode-attribute
https://toolset.com/documentation/legacy-features/views-plugin/using-a-child-view-in-a-taxonomy-view-layout/
In summary, the first parent view will be set to show the 'departments' posts, with a post ID query filter to specify only selective 'departments' posts.
And in the loop of this parent view, a second child view will be nested that will be set to show the 'staff' posts, with a relationship query filter so that only the related posts of the current parent 'departments' post are shown.
I hope this helps and please let me know if you have any follow-up questions.
regards,
Waqar