Problem: I would like to set up a conditional that tests the time of the most recent post edit. If the most recent edit was less than 5 minutes ago, I would like to show some content.
Solution: Use the wpv-post-date shortcode to output a Unix timestamp, subtract that value from NOW(), and compare that value against the number of seconds in 5 minutes (300) using the following syntax:
[wpv-conditional if="( (NOW() - [wpv-post-date type="modified" format="U"] ) lt 300 )"] ...the most recent edit was less than 5 minutes ago... [/wpv-conditional]
Relevant Documentation:
https://toolset.com/course-lesson/using-toolset-conditional-block/
https://toolset.com/documentation/programmer-reference/forms/cred-conditional-display-engine/
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-154574
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
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 2 Antworten, has 2 Stimmen.
Last updated by martinB-16 vor 3 Jahre.
Assisted by: Christian Cox.