Countdown to Specific Day Every Week
Countdown Widget has a really handy shortcut attribute in its shortcode form. That is the “date” field. It is a more human-readable way of defining dates in the shortcode. In this post, I am going to show you how to add a countdown for a specific day each week.
Create a Countdown for Next Monday
In order to create a countdown for a specific day that repeats every week, you can use the following shortcode:
[countdown date="next monday"]
This will work for the countup shortcode, as well:
[countup date="last friday" format="dH"]
Other Examples for Magic Date
Countdown widget uses PHP strtotime function to resolve sentences into dates:
[countdown date="+1 week"]
This function understands most of the common date statements. But you can specify only one condition in the statement.
[countdown date="Second Sunday Of July" format="DH"]
Specify Hours for Magic Date
You can also specify hours for the magic date in the shortcode as in the example below:
[countdown date="next tuesday" hour="8"]
Please note: the Hour attribute here uses a 24-hour system. (Eg. 5 pm should be defined as 17)
Conclusion
In this post, I tried to show you some simple examples of how to use the date attribute of the countdown widget. Using the date attribute of the shortcode we can easily create a countdown for a specific day every week.
I hope you find this post useful, and if you do please rate my plugin here.
All the best.