Countdown Timer with Offset


Notice: Undefined index: tminus_exclude_dates in /var/www/vhosts/spacedonkey.de/httpdocs/wp-content/plugins/t-countdown-control/admin/scripts/functions.php on line 267

Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/spacedonkey.de/httpdocs/wp-content/plugins/t-countdown-control/admin/scripts/functions.php on line 40

This is a countdown timer that actually counts down to 15:15. However, it should display that it is actually counting down to 16:15. so an offset of + 1 hours.

Wk.
0
0
Tage
0
0
Hours
1
8
Minutes
5
8
Seconds
4
0

So how is this done?
As of T(-) Countdown Control version 1.8.9 the target can be filtered with an offset by adding the following to the child-theme functions.php file:

add_filter( 'countdown_offset', 'my_offset', 10, 2 );
function my_offset( $id, $target_time ) {
if($id == '3411'){
$target_time = $target_time + (1 * 60 * 60);
}
return $target_time;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.