Countdown Timer with Offset

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.

Days
0
0
Hours
2
0
Minutes
1
2
Seconds
1
3

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.