Hi Everyone!
I'm would like to use html in the announcement bar.
In particular, a code for this countdown timer:
var countDownDate = new Date("apr 1, 2021 00:00:00 UTC+1").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("demo").innerHTML = days + " Days │" + hours + " Hours │"
+ minutes + " Minutes │" + seconds + " Seconds ";
if (distance < 0) {
clearInterval(x);
document.getElementById("demo").innerHTML = "EXPIRED";
}
}, 1000);
Many thanks in advance!
@StudioM - this custom html may not work from announcement bar field in customizer, hence we may need to put it in the theme code to check
Hi @suyash1 ,
Thanks for your reply.
I know it requires doing something in the backend.
I'm hoping that someone here can tell me what exactly I need to do / where to copy the code to in order to make it work.
@StudioM _ your code looks like js code, I think it will be visible in the place where it is added, if that is the case then will need to add it into announcement bar code in the backend, if you can add me to staff then I can check it and let you know.
User | Count |
---|---|
421 | |
164 | |
98 | |
89 | |
88 |