Skip Navigation

[Resolved] Mix OR and AND logic on custom search filters

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
#916375

Hi, is it possible to use OR logic for some filters and the AND logic for some other filters in the same view custom search?

#916476

Hello,

It is not possible within current version of Views plugin, in Views custom search filters, you can setup only one logic on custom field search filter.

But it is possible with custom codes, see wordpress document:
https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters#Custom_Field_Parameters

And the example codes under text "For example, show products where color=orange OR color=red&size=small translates to the following:"

For your reference.