'Output ACF date value in repeater field based on current date
I have a custom post type called Events. Each event has a Repeater field set up with Advanced Custom Fields Pro. This field allows for multiple event dates to be registered in the post edit screen.
Outputting these date values works just fine. However, what I'm trying to do is limit the output to display only the date that is the next and closest date into the future.
Here's an example if the current date is the 22nd of April:
- 1st of April (in the past so don't show)
- 26th of April (next date so show)
- 29th of April (beyond the next date so don't show)
The reason I need to do this is to be able to only have one page with a consistent url for each event. Furthermore, I want an easy way to display the date for the next upcoming event in post grids and on the event page.
Any pointers on how to achieve this would be highly appreciated!
Cheers! André G
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
