T(-) Countdown | Documentation
The Gutenberg Block
The Gutenberg Block
T(-) Countdown provides a Block that can be used in the Gutenberg editor. The block is located under Common Blocks. Once placed, content to be displayed once the countdown reaches zero can be entered directly in the block. All countdown settings can be found in the Inspector Control Panel displayed on he right sidebar when the block is selected.
The t attribute is used to assigned a date and time in almost any format.
Note: Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.
To avoid potential ambiguity, it’s best to use ISO 8601 (YYYY-MM-DD)
[tminus t="2020-12-20 12:20:00"/]
PHP strtotime formats may also be used.
[tminus t="+2 hours 23 minutes"/]
T(-) Countdown includes two time placeholders %this_year%
and %this_easter%
that can be used with strtotime to target specific holidays:
[tminus t="may 1 %this_year%"/]
Using the %this_year%
and %this_easter%
placeholders will automatically recalculate for next year’s date after the current years target date has past.
The timezone attribute can be used to adjust the timezone if different from the default WordPress timezone set under Dashboard > Settings > General > Timezone. The value entered must be a valid timezone supported by PHP.
[tminus timezone="Europe/Isle_of_Man"/]
A unique ID for the countdown element. If the id attribute is not defined, a unique, random id will be automatically assigned.
[tminus t="31-12-2012 23:59:59" id="new-years-eve"/]
Replaces the default label for ‘years’.
[tminus t="2020-12-31" years="Jahre"/]
Replaces the default label for ‘Months’.
[tminus t="2020-12-31" months="Monate"/]
Replaces the default label for ‘Weeks’.
[tminus t="2020-12-31" weeks="Wochen"/]
Replaces the default label for ‘Days’.
[tminus t="2020-12-31" days="Tage"/]
Replaces the default label for ‘Days’.
[tminus t="2020-12-31" hours="Std."/]
Replaces the default label for ‘Minutes’.
[tminus t="2020-12-31" minutes="Mins."/]
Replaces the default label for ‘Seconds’.
[tminus t="2020-12-31" seconds="Secs."/]
Omit the years form the date display. Use ‘true’ to hide the years. Years will be displayed by default.
[tminus t="2020-12-31" omityears="true"/]
Omit the months form the date display. Use ‘true’ to hide the months. Months will be displayed by default.
[tminus t="2020-12-31" omitmonths="true"/]
Omit the weeks form the date display. Use ‘true’ to hide the weeks. Weeks will be displayed by default.
[tminus t="2020-12-31" omitweeks="true"/]
Omit the seconds form the time display. Use ‘true’ to hide the seconds. Seconds will be displayed by default.
[tminus t="2020-12-31 17:30:00" omitseconds="true"/]
Defines the style to be used by the countdown. If not style is defined the jedi style will be used by default.
[tminus t="2020-12-31" style="darth"/]
Content to be displayed directly above the countdown.
[tminus t="2020-12-31" before="<p>May the force...</p>"/]
Content to be displayed directly below the countdown.
[tminus t="2020-12-31" after="<p>...be with you.</p>"/]
Launchtarget Attribute
The area that the post-launch HTML will display upon launch. Valid launchtarget options include:
[tminus t="2022-12-31" launchtarget="bothtml"]
content to display on launch
[/tminus]
[tminus t="2022-12-31" launchtarget="#element_id_name"]
launch content
[/tminus]
There are a few basic sizing attributes that can be used to define the width and height of the countdown element before and after launch.
The pre-launch width in px of the countdown – default is ‘auto’.
[tminus t="2020-12-31" width="300"/]
The pre-launch height in px of the countdown – default is ‘auto’.
[tminus t="2020-12-31" height="200"/]
The post-launch width in px of the countdown – default is ‘auto’.
[tminus t="2020-12-31" launchwidth="300"/]
The post-launch height in px of the countdown – default is ‘auto’.
[tminus t="2020-12-31" launchheight="200"/]