[countdown]
The shortcode displays a dynamic countdown timer.
Product
Shortcode Attributes
There are a number of shortcode attributes available which you can use to customize the output.
- datetime – The target date and time for the countdown in
YYYY-MM-DD HH:MM:SSformat. - format – The format of the datetime string.
- Default:
Y-m-d. - Options: Refer to WordPress Date and Time Formatting
- Default:
- days_label – Label to display for the days component.
- Default:
Days.
- Default:
- hours_label – Label to display for the hours component.
- Default:
Hours.
- Default:
- minutes_label – Label to display for the minutes component.
- Default:
Minutes.
- Default:
- seconds_label – Label to display for the seconds component.
- Default:
Seconds.
- Default:
- expire_message – Message to display when countdown expires.
- Default:
Expired.
- Default:
- classes – Additional CSS classes to add to the countdown container.
Example Usage
[countdown datetime="2025-12-31 23:59:59" expire_message="The event has started!"]
[countdown datetime="2025-12-31 23:59:59" days_label="D" hours_label="H" minutes_label="M" seconds_label="S"]
Results
| Example 1: This example displays a countdown timer that counts down to December 31, 2025, at 23:59:59, and shows “The event has started!” once the target time is reached. Example 2: a countdown timer showing the remaining days (D), hours (H), minutes (M), and seconds (S) until December 31, 2025, at 23:59:59. |
If the datetime is invalid or doesn’t match the format, nothing will be rendered.