WordPress Countdown Widget supports count-up timers since version 2.5. It also has support for full shortcode functionality. In this post, I am going to show you how to easily add count-up timers to your WordPress posts using shortcodes.
Count-up Shortcode Basic Syntax
[countup date="10 July 1856"]
That’s the age of Nikola Tesla if he lived today ;) And yes, I am a fan of him :)
Limiting Digits on Count-up Shortcode
To limit the number of digits to display, we can use the format option of the shortcode as in the example below:
[countup date="10 July 1856" format="ydhms"]
Or, We can try a more crazy format like this:
[countup date="10 July 1856" format="s"]
Well, there is a catch about all countdowns and count-ups; timezones. When you are counting up time since you were born, you are using your own watch. But what if you wanted to use a Japanese one? This will be easy using the Countdown Widget:
[countup date="10 July 1856" format="ydhms" timezone="+9"]
[countup date="10 July 1856" format="ydhms" timezone="-4"]
Please note that those are not all of the options for the shortcode. Visit countdown shortcode documentation page to view all the options available.
And a Final Count-up
[countup year="0" month="1" day="1" format="ydhms"]
Strange enough, even if you set the year to zero, the countdown starts from 1900. That’s the thing with computers date algorithms, so nothing to do with the widget code :)