Add a Dynamic Copyright Year to Your Squarespace Site

To create a dynamic copyright year on your Squarespace site, you can use a small JavaScript snippet that updates the year automatically. Here's how to implement it:


Step 1: Add the JavaScript

  1. Log in to your Squarespace site.

  2. Navigate to Settings > Advanced > Code Injection.

  3. In the Footer section, paste the following JavaScript:

<!-- Date auto updater --> <script> document.addEventListener("DOMContentLoaded", function() { const copyrightElements = document.querySelectorAll(".dynamic-year"); copyrightElements.forEach(element => { element.textContent = new Date().getFullYear(); }); }); </script>

4. Save your changes.

This script finds all elements with the class ‘dynamic-year’ and updates them with the current year.


Step 2: Add the Dynamic Year Element

  1. Go to the Squarespace page where your copyright information is displayed.

  2. Replace the static year with this HTML:

<span class="dynamic-year"></span>

3. For example, your copyright section might now look like this:

© <span class="dynamic-year"></span> Your Company Name

Step 3: Add Custom CSS

  1. Navigate to Design > Custom CSS.

  2. Add the following code to style the dynamic year and the entire block:

.dynamic-year { 
color: white; font-size: 0.85rem;
} 

#block-yui_3_17_2_1_1733844344098_19048 { 
font-family: Space Grotesk !important; 
font-size: 0.85rem; color: white;
}

3. Save your changes.

This CSS ensures the dynamic year text and the overall block have consistent styling with your site's design.


Step 4: Customize the Block ID

  1. Replace #block-yui_3_17_2_1_1733844344098_19048 with the Block ID of the block you want to apply the effect to.

How to Find a Block ID in Squarespace

  1. Open your site in a browser.

  2. Right-click on the block you want to edit and select Inspect (in Chrome) or your browser’s developer tools.

  3. Look for the unique ID associated with the block, which typically starts with #block- followed by a string of numbers and letters.

  4. Copy the ID and replace it in the code snippet above.

Or, you can download Will Myers free chrome plugin, ‘Squarespace ID Finder’, from the Chrome store.

Previous
Previous

Why Calendly Is the Best Scheduling App: What Makes It Shine Above the Rest

Next
Next

Why Squarespace Beats WordPress as the Best CMS