Tell us what you are trying to do?
I need to set up 4 price range in custom search fields:
- All
- up to 90
- from 91 to 120
- above 121
At the moment I set it in filters like that:
- nothing; All
- <90; to 90
- >91 =<120; between 91 and 120
- >121; above 121
Only "- nothing; All" works, how should I set other 3 values?
I am sending you 2 screens
Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
What is the link to your site?
versteckter Link
Hello,
Your screenshot isn't in English, that did not help much.
I assume we are talking about a custom numeric field, and you are going to add a selector range filter on this custom field.
If it is, it needs custom codes, for example, you can setup the selector "price-range" option values as below:
- All: 0 - 999999
- up to 90: 0-90
- from 91 to 120: 90-120
- above 121: 121-999999
Then use Views filter hook wpv_filter_query to trigger a PHP function, in this PHP function:
1) get the URL parameter value of "price-range",
2) explode the value to an array using separator "-"
3) Apply above array value into View's field query
More help:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.
https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
compare (string) - ... 'BETWEEN',