Code

Dynamic Copyright Year

Quite manually updating your Webflow sites copyright year with this Javascript code snippet. This Javascript code snippet will automatically display the current year for copyright years in footers and other elements in which you want to show the current year.

Dynamic Copyright Year preview

Quite manually updating your Webflow sites copyright year with this Javascript code snippet. This Javascript code snippet will automatically display the current year for copyright years in footers and other elements in which you want to show the current year.

How to add it

  1. Add the Javascript code snippet to your closing body section of your custom code
  2. Add the class copyright-year as a span in your text element

The code

Javascript
                      <!-- Add to closing body tag-->
<!-- Set Footer Copyright Year -->
<script>
Webflow.push(function() {
    $('.copyright-year').text(new Date().getFullYear());
});
</script>

                    

Browse similar code snippets

Categories

Language

More from Corey Moen

Profile →

Related Webflow questions

All answers →

Similar code snippets

All code snippets →