Forums › Forums › Search & Filter Pro › Filter events by upcoming
- This topic has 11 replies, 3 voices, and was last updated 6 years, 3 months ago by Anonymous.
-
Ross Moderator(Private) July 26, 2018 at 3:42 pm #183615
Ah ok, I understand.
I’m afraid the way you are going about it won’t work.
When using most of S&F’s filters, we actually don’t create a standard query.
We perform some background queries, to get the post IDs, of all the results of that date.
It is then fed into the WP_Query, in the
post__in
argument of the query you have been trying to modify above, BUT, when a single date is selected, thepost__in
part will only have the IDs of results on that date, so any additional meta query won’t pull in the extra IDs needed.Anyway, fear not, for now there is a workaround.
What you’ll want to do, is create a date range, and set the second (to) field (via programming) of the date range, to some point far in the future. Then you’ll need to hide the second date field with CSS.
The user will only see the from field, and choose a specific day, but in actuality its comparing between today, and some point in the far future.
I explained how to set the value of the second date field via PHP in this reply:
https://support.searchandfilter.com/forums/topic/infinite-scroll-not-working-on-initial-load/page/3/#post-182076I hope all that makes sense – let me know if you have any further questions.
Thanks
Anonymous(Private) July 27, 2018 at 9:17 am #183676Awesome, it works!! It does have a few minor things I need to work around. The (from) date field needs to be pre-filed because if the user tries to search using a keyword and the (form) date field is empty it will find no results.
I’ve pre-filed it using the same method you used to pre-fill the (to) date field, which should work for now.
Thank you again for helping me out with this! If I have anymore queries I’ll be sure to come back 🙂
-
AuthorPosts