Jump to content

Add mobile number into site header

Recommended Posts

Posted

Hi All,

I need help adding my mobile number into my site header section. The version I'm using has a appointment button and social link but I can't add a mobile number which is important. Any help would be amazing. This is not my forte at all.

Please help

Olwen

  • Replies 3
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 year later...
Posted

Add this code into pages > web tools > code injection > footer:

<script>
  document.addEventListener('DOMContentLoaded', function () {
    // Find the header container
    var header = document.querySelector('.header-display-desktop');
    
    if (header) {
      // Create a new span for the phone number
      var phoneNumber = document.createElement('span');
      phoneNumber.textContent = 'Call us: (123) 456-7890';  // Replace with your actual phone number
      phoneNumber.classList.add('phone-number-style');  // Add a class for styling
      
      // Append the phone number to the header
      header.appendChild(phoneNumber);
    }
  });
</script>

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.