Problem: I would like to create a conditional that tests the value of a custom date field. If the date is today - the current date - then I would like to display some content. However, testing the value against TODAY() does not seem to work.
Solution: You must create a conditional that tests if the date value is between the end of yesterday - TODAY() - and the beginning of tomorrow - FUTURE_DAY(1).
[wpv-conditional if="( $(wpcf-birthdate) gte 'TODAY()' ) AND ( $(wpcf-birthdate) lt 'FUTURE_DAY(1)' )"] Happy Birthday! It's today! [/wpv-conditional]
Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 4 replies, has 2 voices.
Last updated by 6 years ago.
Assisted by: Christian Cox.