Forums › Forums › Search & Filter Pro › Range Slider is getting triggered by default
Tagged: range slider, V3
- This topic has 12 replies, 3 voices, and was last updated 4 years, 8 months ago by Trevor.
-
Ross Moderator(Private) March 19, 2020 at 11:25 am #237164
Hi again
So I’ve had a chance to digest this ticket.
In regards to your two issues which are both part of the same problem:
The way a form submits / resets is to include the sliders at their min / max value. We will try to address this in v3 within the plugin, but for now, if you want to have the same set of results when you reset as when you land on the page you have 2 options:
a) set a default value on all other posts – you can write a query to loop through all posts where there is no value for this post meta, and then auto add a value like
0
b) restict the meta query to the slider min/max params (you would have to use fixed min/max limits), you can do that from the
post meta
tab in your search form – this way the results that are shown when landing on the page, are teh same as when the form is reset / submitted, and the range slider params are added to the URL.—
In regards to the filter:
sf_edit_query_args
, this is run before S&F applies its workings… S&F does a different kind of query, outside of your WP_Query, which is then combined with the WP_Query, so you can never truly unset that value. Your best bet would be to simply dounset($_GET['filter_name']);
(you can dump this in the bottom of your functions.php to test) before S&F grabs the value and applies its sorting.I hope that clears a few things up for you?
Let me know if you have any further questions.
Thanks
-
AuthorPosts