Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Filter events by upcoming

Viewing 2 posts - 11 through 12 (of 12 total)
  • Ross Moderator
    #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, the post__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-182076

    I hope all that makes sense – let me know if you have any further questions.

    Thanks

    Jessica Spata
    #183676

    Awesome, 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 🙂

Viewing 2 posts - 11 through 12 (of 12 total)

The topic ‘Filter events by upcoming’ is closed to new replies.