Hi,
Thank you for contacting us and I'd be happy to assist.
This particular requirement is quite different and more complex than what was discussed in the other ticket with Jamal.
In that ticket, Jamal guided how multiple relationship search filters can be included, and here you need a single page where custom fields from multiple relationships (intermediary posts) can be used for filtering.
The way WordPress meta query works, it will skip all the posts where the custom field that is being used for the filtering doesn't exist.
For example, suppose you have two post types:
1. Shops
2. Books
If you'll create a view to show posts from both these post types, it will show the complete list. But, if you'll include a search/query filter for a custom field, e.g. "Shop Location", that is attached to the "Shops" posts, but not with the "Books" posts, then all "Books" posts will automatically be skipped/ignored.
Keeping this limitation in mind, I'm afraid, I can't think of a practical way to make this all-inclusive filtering work from within the same view or archive, even with code customization. Here is how I would achieve something similar, as a workaround:
1. I would create separate post views for each relationship connection (intermediary post types) and each view will only hold the custom field filters for the respective intermediary post type.
2. On a new page, I would add all these new views and hide them when the page loads.
3. On the top of the same page, I would add a custom select field, that will show all the relationship connections, as an option, so that the visitor can select which type of filter they plan to use.
3. Using some custom script, I would show only the view for the selected option, so that visitors can see and interact with that particular view's search fields and results. To use the search fields from the different relationships, the visitor can change the selection from the top and the respective view and its search fields will become available.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar