Date field filters
Overview
Use date field filters to control which posts or products appear in a loop based on specific date values. This feature supports time-sensitive queries such as event listings, promotions, or archival views where only certain time ranges should be visible.
Common use cases include:
- Displaying upcoming or past events using an ACF Date Picker field.
- Highlighting limited-time offers or seasonal campaigns.
- Showing posts scheduled for future publication.
Where to find it
- In the Divi 5 Builder, select the parent container with Loop enabled.
- Open the Loop accordion.
- Locate the Order By dropdown and select ACF Date Picker, Publish Date, or another date-aware option.
- Additional date settings appear dynamically depending on your selection.
Date Picker Settings
Setting | Description | Example |
---|---|---|
Date source | Select which date field to evaluate — options include Publish Date, Last Modified Date, or ACF Date Picker Field. | Choose ACF Date Picker Field for an events calendar. |
ACF Date Picker Field | When using ACF, select which field provides the date value. | Select event_start_date . |
Date Picker Method | Determines how the date is evaluated — e.g., “Default,” “Before today,” or “After today.” | Use After today to show upcoming events. |
Custom Day Count | Specify a custom day range if using relative date logic. | Enter 30 to show events within the next 30 days. |
Date Picker Methods
Method | Description | Example |
---|---|---|
Default | Evaluates the selected date field exactly as stored, without comparing it to the current date. Useful for neutral sorting or displaying all items regardless of time. | Use Default to sort posts by event_date without filtering out past or upcoming entries. |
Today | Displays only posts where the date matches today’s date. Ideal for daily agendas, schedules, or content published or occurring today. | Use Today to show events happening on the current day. |
Today and Future | Shows posts with a date equal to or after today’s date. Commonly used for upcoming events, deadlines, or scheduled items. | Use Today and Future to list events starting today or in the future. |
In the Past (Before Today) | Displays posts with a date before today’s date. Ideal for archived, completed, or past events. | Use In the Past (Before Today) to show events that have already occurred. |
Last 7 days (including today) | Returns posts with a date within the past seven days up to and including today. Useful for weekly recaps or recently completed events. | Use Last 7 days (including today) to show articles published in the last week. |
Yesterday and past x days | Displays posts from a user-defined range ending yesterday. The number of days is controlled by the Custom Day Count field. | Use Yesterday and past x days with a custom count of 30 to display items from the last 30 days (excluding today). |
Example configurations
Example 1: Upcoming events
- Date source:
ACF Date Picker Field
- Method: After today
- Order By: Ascending
Displays only future events using a customevent_start
ACF field.
Example 2: Past content archive
- Date source: Publish Date
- Method: Before today
- Order By: Descending
Creates a chronological archive of past posts or releases.
Integration notes
- Works with ACF Date Picker and DateTime Picker field types.
- Can be combined with other Loop Extender filters (taxonomy, author, or current user).
- Sorting by the same field ensures predictable order when using date-based filters.
- Relative logic such as “today,” “past,” and “upcoming” is derived dynamically when using ACF fields.