- This topic has 2 replies, 2 voices, and was last updated 10 years, 8 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 › initial filter from query var
Hi,
I have search and filter pro, it’s a wonderful plugin!
I need to select the filter from the beginning with the value of ‘query var’ from another page.
I’ve done this:
$value = get_query_var('year');
....
<script>
$('input[value="<?php echo $value ; ?>"]').click();
</script>
But this method is far from ideal because first are charged all items then with click event the filter is activated.
Is there a better method?
Thanks
Hmmm its not something I’ve tried yet (but will be a feature in the future), you could also look at preventing a submit happen
So something using $('.searchandfilter').on("submit") and perhaps (e.stopEventPropogation()) only on the first submit (which is caused by your custom code)
Thanks