Divi comes with a countdown timer module that lets you display the days, hours, minutes and seconds left until an event. The module doesn't currently give you an option to change the "Day(s)", "Hour(s)", "Minute(s)" and "Second(s)" text to something of your choosing. If you want to change these labels, here are a couple of ways to do it.
Changing the Countdown Timer Labels with Divi Booster
As of Divi Booster 2.5.9, there is a new option for easily modifying the countdown timer module's labels.
In the Countdown Timer Module Settings, you'll find a "Use Custom Labels" option added by Divi Booster. Set this to option to "Yes" and some additional fields will appear (as shown below). These let you set the text of the various labels on both standard view and mobile view. No need for code, and you can control the labels on a module-by-module basis.
Changing the Countdown Timer Labels with JavaScript
<script>
jQuery(function($){
setTimeout(function(){
// Get the timers
var timers = $('.et_pb_countdown_timer');
timers.each(function(){
var timer = $(this);
// Get the label objects
var days = timer.find('.days');
var hours = timer.find('.hours');
var mins = timer.find('.minutes');
var secs = timer.find('.seconds');
// Change labels on desktop
days.data('full', 'Days');
hours.data('full', 'Hours');
mins.data('full', 'Minutes');
secs.data('full', 'Seconds');
// Change labels on mobile
days.data('short', 'Day');
hours.data('short', 'Hrs');
mins.data('short', 'Min');
secs.data('short', 'Sec');
// Apply changes
window.et_countdown_timer_labels(timer);
});
}, 0);
});
</script>
Related Post: Adding JavaScript / jQuery to Divi.
You'll notice that there are different labels used by the countdown timer when displayed on mobiles (and thinner columns), which you can also adjust by changing the lines below "// Change labels on mobile".
hello, i want to remove or not showing days counter. can i do that with this booster?
Hey Josh, there's not an option for this at the moment (though I'll try and add it in the future). In the meantime, this post explains how to do it with CSS:
https://divibooster.com/hide-days-in-countdown-timer-module/
Hope that helps!
I am using the countdown timer but instead of one line i get the display
Days
:
Hour
:
Minutes
:
Seconds
Any suggestions
Hi Peter, sorry to hear this. Is there any chance you're able to set up an example page showing the problem, so that I can take a look for you? Thanks!
Hi Dan,
I own Divi Booster and I activated custom labels but don't work. I have the latest version of Divi and Divi Booster and I use italian language (that has some broken translations). Can you check it please? Thank you.
Hey Alessandro, is there any chance you're able point to me to an example page showing the problem? I took a look round the site linked in the comment, but the only countdown timer I could find was on the page for the 2020 expo page and seems to be implemented via a code module (guessing maybe you were using the countdown timer here originally?). I just checked and the feature is still working for me with the latest Divi, so I'm not sure why it wasn't working for you – I should be able to tell you more if I can see an example. Thanks.
Hi Dan, it works perfectly from Desktop, bu from mobile I always see the old labels: any suggestion?
Hey Walter, the code seems to be working correctly on mobiles on my test site (latest Divi), so I'm not quite sure why you're getting this behavior. One possibility is caching. If you're looking on an actual mobile device (rather than just resizing the window on your desktop to a mobile width), I'd try clearing the browser cache on the mobile and then reloading the page. If that doesn't work, are you able to send me a link to the page you're working on so that I can take a look? Thanks!
Love this! Finally an easy way. As I've been looking for this. Really appreciate your add-on. It makes great use of our web.
Hmm, strange. Activated custom headings but it do not work. Empty cache on both server and in browser. But it does not help. I may return to the workaround and use the same color as the background color, to hide the incorrect translations.
Hey Magnus, I just implemented this today and maybe I missed something. I'm just finishing for the night, but if you're able to send me a link to the page you're working on, I'll take a look tomorrow and see if I can spot the problem. In the meantime, it might be best to do your color change trick. It won't stop me being able to see what I need to. Hopefully I can get you up and running so you can put the correct translations in place. Thanks!
http://www.stratiteq.com/gdpr
Right now the labels are in black, on black background. I hope you understand Swedish ;-)
Ha ha! Not even slightly :) The issue was that my code wasn't applying correctly on non-English sites. I've come up with a fix that will be in v2.6.0, which should be out in the next day or so. Hopefully that will solve it for you, but let me know if not. Cheers!