Skip Navigation

[Resolved] Multiple Relationship Filter

This support ticket is created 4 years, 11 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 4 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1664077

I have 2 (many to many) relationships connected to one item. A city relationship and category relationship.

Right now if I create a view and filter the relationship with the category, I can not filter it with the city.

I'm creating a basic service provider list and I can't narrow the scope to city because the category negates the filter. What is the work around

#1664433

Hello,

Within Toolset Blocks/Views plugins GUI, you can add only one relationship filter, you can not setup multiple relationship filter in same view.

As a Workaround, you can try to add other relationship filters with filter hook "wpv_filter_query", for example this thread:
https://toolset.com/forums/topic/search-filter-with-two-post-relation-ships/#post-1216763

More help:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/how-to-migrate-your-site-to-new-post-relationships/#advanced-example