Tell us what you are trying to do?
I am trying to: Display a list of Calendar events, the list should only display posts which have a custom field value of greater or equal to the current time. I also want to allow users to filter between two dates.
As we can't use the same custom field more than once in the filter GUI I have used a conditional filter to filter out old dates in the content template. However, this makes pagination inaccurate and unworkable.
[wpv-conditional if="( $(wpcf-start-calendar-date) gte 'NOW()' )"]<div class="list-bdr-1">
[wpv-post-link] <span class="event-date">[types field='start-calendar-date' style='text' format='F j, Y g:i a'][/types]</span><br>
</div>[/wpv-conditional]
Filter:
Start-Calendar-Date is a string between URL_PARAM(wpv-wpcf-start-calendar-date_min), URL_PARAM(wpv-wpcf-start-calendar-date_max)
Is there a workaround for this? or am I missing something?
Link to a page where the issue can be seen: hidden link
There is no practical way to do that natively in a View's Query and conditions.
What you can do is apply one filter to a certain Field in the GUI (as a Query filter or even as a Front End Filter), and then you can add additional filters to the same Field using Toolset Views' API:
https://toolset.com/documentation/programmer-reference/views-filters/
The hook wpv_filter_query will help you to modify the query sent to WordPress and add as many additional filters you want:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
That allows you to alter the entire query sent, and add as many or remove/alter as many arguments you need.
But maybe you can profit from some work already done by users in past:
hidden link
This could be a great starting point for the Custom Code that you will need for this.
I think i'll need to see the knowledgebase article to get a better idea, how can I access it? Do I need an account?
Oh, that snippet is not public.
I apologise, I did not notice it.
I have made it public now, however, consider it is an example only, you cannot use this as-is, as custom code always needs to be adapted.