FYI with this plugin I see a lot of errors like this:
TypeError
null is not an object (evaluating ‘document.getElementById(num).innerHTML’)
in public.js:
function run_countdown(num) {
var str = document.getElementById(num).innerHTML;
if(str === '0'){
]]>
The Author seems to have given up on this plugin, so I’ll put my solution in case it helps others.
Open the main plugin file /wp-content/plugins/wp-countdown-timer/wordpress-countdown-timer.php
Replace the lines 69-76 with the following :
(remember to use your own timezone)
function countdown_timer_shortcode(){
// Set this to your timezone:
// https://php.net/manual/en/timezones.php
date_default_timezone_set('Australia/Brisbane');
$date_to = get_option('countdown-timer-date');
$date_from = date('m/d/Y h:i:s');
//echo $date_from."";
//echo $date_to;die;
$date_to = new DateTime($date_to);
$date_from = new DateTime();
$date_diff = $date_from->diff($date_to,false);
]]>
I get the following in my browser console when attempting to render the timer using:
<?php do_shortcode( ‘[countdown]’ ); ?>
“
public.js?ver=1.0.0:7 Uncaught TypeError: Cannot read property ‘innerHTML’ of null
public.js?ver=1.0.0:7 Uncaught TypeError: Cannot read property ‘innerHTML’ of nullpublic.js?ver=1.0.0:7 run_countdownpublic.js?ver=1.0.0:2 (anonymous function)
“
the rest of my site stops rendering altogether.
Thanks
Paul
Hi I have added the plugin using the dashboard but when I use the short code on one of my webpages that page just loads constantly and doesn’t actually download any content?
]]>Fatal error: Call to undefined method DateTime::diff() … /wp-content/plugins/wp-countdown-timer/wordpress-countdown-timer.php on line 76
Avada Theme
all up-to-date
We would like to set the time properly but are unsure what time it’s using in the first place.
If we set it to: 2014-06-25T16:00
It will finish after midnight.
What time should we calculate from?
D
]]>WE would like to set the time properly but are unsure what time it’s using in the first place.
If we set it to:
2014-06-25T16:00
It will finish after midnight.
D
]]>hello
wanted to ask how is the countdown works?
i want to attach the countdown option to a button
when i start a countdown i want that the button start a css class and when the countdown end return to original css class
thanks
]]>Hello,
can your countdown count up after the countdown is down?
Countdown:
0Year 1Month 2Weeks 1Day 4Hours 1Minutes
after this date
Countup:
0Year 0Month 2Weeks 4Day 5Hours 10Minutes
Is this possible with your Pugin?
]]>Hi i want to set time zone from UTC to UTC +05:30, i saw that Currently it is in just UTC.
]]>Is there a way to insert this into the header by using php code instead of the shortcode?
]]>Hi,
I would like to know if it’s possible to show only the days,hours,minutes and seconds. That way, the years and months should be added & counted all as days.
Sorry for my english. I hope you know what I mean.
Best regards.
]]>