Dynamic Copyright Year

</ head>

</ body>

<!-- Dynamic Copyright Year -->
<script>
	// Dynamic Copyright Year
	var date = new Date().getFullYear();
	document.getElementById("year").innerHTML = date;
</script>

HTML/Embed

Author
Noah Raskin
Published
Jun 12, 2020

How to use:

This code crumb is super simple to use. This snippet can be pasted in the </ body> section of the custom code area either in your page settings or in your sites global settings like we do on this site since we are using a symbol site wide for the footer. Meaning we have it pasted once in our sites custom code section so it gets used on every page.

Once we have that done we can go to our footer or where ever you want to display the current year in the designer and wrap the year in <span> tags. You can do this by highlighting the text/year and selecting the brush icon in the tool tip as shown below:

Now you can select that span tag and give it any class name you want but we do have to give it a specific ID called "year". While our year/span is selected navigate to the element settings panel on the right and under ID write "year" (without the "" of course lol).

It's as simple as that. Publish your site and have a look at your copyright year. It will always be current 😉

Tutorial Coming Soon!

Check Browser Support

Interactive Table

Comments

Unfortunately at this time we don't have SSO for comments so you will have to sign up separately to leave your comment. Thanks for understanding!

This short Javascript code crumb will allow you to dynamically set the current year for your © copyright year in your footer automatically.

Clone Project
Documentation
Author:
Built by
Built with
For the best experience

Please switch to desktop to view the content.

Back Home
Thank you! Your submission has been received!
Close Form
Oops! Something went wrong while submitting the form.
Become a Contributor