Problem:
How to add a query filter to a view which shows posts with a custom date field value from the past year.
Solution:
When adding the query filter, values such as PAST_YEAR and PAST_MONTH will refer to the beginning of the period.
So comparing a date to PAST_YEAR = 2 would count back 2 years from the current date and rewind to January 1 of that year.
To go back exactly one year use PAST_DAY = 365.
Relevant Documentation:
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+01:00)
This topic contains 4 replies, has 2 voices.
Last updated by kelvinL-2 7 years, 11 months ago.
Assisted by: Nigel.