- This topic has 2 replies, 2 voices, and was last updated 10 years, 6 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › How to make a ">=" compare dropdown field
Hi,
I have a dropdown post meta field with numbers (1 – 5). It will filter an ACF field where a number can be set. The filter works great, if I choose 3, it will show all results that are set to 3. However I want to change the compare to ‘greater then or equal to’ (>=).
I did try to change rule number 470 in ‘class-search-filter-setup-query.php’ and added there “compare” => “!=” just for testing, however this does not work. I do believe this is where the query is setup, how should I do this properly?
Thanks!
Hey Lars
Its not yet possible with the plugin, but I do plan to add this in.
In terms of changing the plugin code, there are 2 files the query is created depending on your setup.
If you are displaying your results as an archive, then the above file is correct – however if you are displaying your results using a shortcode (under the “display results” tab) then the correct file is:
class-search-filter-get-results.php
Its a bit messy, S&F 2.0 is a lot cleaner and for all display methods the query is created in 1 place – should be out soon.
Thanks