Tell us what you are trying to do?
I have a view for events custom post type. Events have a custom field for Date. I want this view to only show past events based on today's date. When I go to the view and add a filter. The date custom field does not show in the options to filter by.
Hello. Thank you for contacting the Toolset support.
I would like to know that have you created Events custom post type and custom date field using Toolset Types plugin or you are using third party events plugin? Can you please share how you configure the custom date field?
You should filter your view by your custom date field lower than equal to Now() by adding a query filter from query filter section of your view.
For example:
Select items with field: your date field is a UNSIGNED lower than or equal NOW()
To do that, you should edit your view and navigate to "Query Filter" section and add query filter for your custom date field and select "UNSIGNED" and further select "lower than" further select NOW().
That is really strange. Can you please share the view you created and also share the admin access details and let me review your current setup and check whats going wrong with your setup.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Before we do that. I might have found the issue. I have a user filter for the same date-ce field. When I remove that filter I can use the view filter for that field.
Is it possible to have the filter on the view and a filter in the search section be based on the same field?
Yes - we can do that but before I say anything I will have to review your current structure.
You want that the posts displayed by view should be past date posts and then user should also be able to filter the post with the same date field - correct? If yes:
I need to review your views settings first.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
As you have a user filter available - how you want that it should work.
- When view is displayed you only want to display past posts and when user select the date from the frontend filter - do you still want to display past posts based on the selected date by the user from the frontend?
And with your view's "Query Filter" section I've change your custom date filter as given under:
=> hidden link
Date is a number lower than URL_PARAM(wpv-wpcf-date-ce)
Can you please share with what view you have issue with and on what page you have added that page and you want to filter with what future or past event?