By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
  • U.S.
  • International
  • Canada
  • News
  • Business
  • Information
  • Education
  • Books
  • Health
  • Technology
  • Sports
Reading: Carrington Mobile Theme Customization: Add date and time on the header
Share
DaiLy4mativeDaiLy4mative
Watch TV
  • News
  • Business
  • Information
  • Education
  • Books
  • Health
  • Technology
  • Sports
Search
  • TRAVEL
  • More
    • BANKS
    • MP3 Download
    • News
    • Uncategorized
Have an existing account? Sign In
Follow US

Carrington Mobile Theme Customization: Add date and time on the header

Carrington Mobile theme
SHARE
- Advertisement -
Contents
Steps to customize Carrington mobile theme with Date and time.

To customize Carrington mobile theme with date and time feature that updates in realtime please follow below steps. Putting date andtime on your wordpress theme has become very easy where there are so many args that can call up real time and date just however you want it.
It may not be easy to do this especially if you are not a developer but I have simplified it and provided you with the exact code that I am using on daily4mative.com. With less talk let’s do more action.

Steps to customize Carrington mobile theme with Date and time.

NB: Please note that this works in every theme.

    1. Log in to your cPanel.
  1. Locate your header.php file
  2. Inside it scroll to the place you want it to appear and
  3. finally add below code I provided for you.

<script type=”text/javascript”>
var tday=[“Sunday”,”Monday”,”Tuesday”,”Wednesday”,”Thursday”,
“Friday”,”Saturday”];
var tmonth=[“January”,”February”,”March”,”April”,”May”,”June”,”July”,
“August”,”September”,”October”,”November”,”December”];
function GetClock(){
var d=new Date();
var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),
nyear=d.getFullYear();
var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap;
if(nhour==0){ap=” AM”;nhour=12;}
else if(nhour<12){ap=” AM”;} else if(nhour==12){ap=” PM”;} else if(nhour>12){ap=” PM”;nhour-=12;}
if(nmin<=9) nmin=”0″+nmin;
if(nsec<=9) nsec=”0″+nsec;
var clocktext=”<span style=”font:12pt Arial; color:#fff;”>”+tday[nday]+”, “+tmonth[nmonth]+”
“+ndate+”, “+nyear+”</span> <span style=”font:12pt Arial; color:#fff; background: #3e3; border-radius: 5px;padding: 2px;”>”+nhour+”:”+nmin+”:”+nsec+ap+”</span>”;
document.getElementById(‘clockbox’).innerHTML=clocktext;
}
GetClock();
setInterval(GetClock,1000);
</script>

You Might Also Like

Gaming Lenses: All You Need To Know About The XP Pro Lens For Gamers

French startup Alan Plans to build healthcare super app with €183 million funding that will cater for all questions for your health

6 easy steps to block your IP address from Google Analytics

Why Facebook, Instagram and Whatsapp is down

TWRP Recovery: twrp restore stock recovery, solution and best practices

TAGGED: Carrington Mobile Theme
Eric September 17, 2019
Share this Article
Facebook Twitter Whatsapp Whatsapp Email Print
Leave a comment

Leave a Reply Cancel reply

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

Latest Post

  • SportyBet Kenya: Review, Registration, Bonuses and payment methods
  • Chris Brown – Sensational Ft. Davido & Lojay Lyrics
  • Alan Walker Unity Lyrics: In the dark of night the stars light up the sky lyrics
  • Chucks Da Spaceman Biography, Age, Education, State of Origin, Career, Current Radio anchoring, net worth and family
  • Tiwa Savage Sick, Postpones London Show As She Fights A Virus

© Daily4mative. All Rights Reserved.

Removed from reading list

Undo
AdBlock Detected
Our site is an advertising supported site. Please whitelist to support our site.
Okay, I'll Whitelist
Welcome Back!

Sign in to your account

Register Lost your password?