Auto-updating copyright year in the footer
-
Hey guys,
Is there any simple way to add an auto-updating copyright year into the Laytheme’s text editor to read, ie. ”© 2020 Laytheme.com All rights reserved.”?
Thanks
-
-
@mariusjopen and @arminunruh
I know this is an old post, but I'm trying to do the same, however like this "© 2018—2023" in a Footer page.
I have a text box inside the footer with the following source code:<p>© 2018—<span id="currentYear"></span></p>And i'm adding some custom JS in "Custom HTML at bottom":
<script> window.laytheme.on("newpageshown", function(){ jQuery("#currentYear").text((new Date).getFullYear() ); }); </script>This is working perfectly on desktop, however I can't seem to make it work on mobile. It's just shows "© 2018—".
I already tried a few things but without success. Do you have any idea how to fix this?Here's the link if you want to check it —> https://aaltar.com/homepage-2023/
-
i think id's are meant to be unique maybe thats why it doesnt work
try
<p>© 2018—<span class="currentYear"></span></p>both in your desktop layout and your custom phone layout
and then<script> window.laytheme.on("newpageshown", function(){ jQuery(".currentYear").text((new Date).getFullYear() ); }); </script> -
i think id's are meant to be unique maybe thats why it doesnt work
try
<p>© 2018—<span class="currentYear"></span></p>both in your desktop layout and your custom phone layout
and then<script> window.laytheme.on("newpageshown", function(){ jQuery(".currentYear").text((new Date).getFullYear() ); }); </script>@arminunruh I tried this, however, as soon as I change the source code of the text box to 'class' and click OK, the source code changes (automatically) to '<p>© 2018—</p>'. It completely removes the span tag if there's a class instead of an id...I don't know why.
Is there another solution for this?
-
i think id's are meant to be unique maybe thats why it doesnt work
try
HTML:
<p class="currentYear">test</p>JS:
<script> window.laytheme.on("newpageshown", function(){ jQuery(".currentYear").text("© 2018—" + (new Date).getFullYear() ); }); </script> -
i think id's are meant to be unique maybe thats why it doesnt work
try
HTML:
<p class="currentYear">test</p>JS:
<script> window.laytheme.on("newpageshown", function(){ jQuery(".currentYear").text("© 2018—" + (new Date).getFullYear() ); }); </script>@arminunruh I think it was because the span tag was empty. It works now!!
Thank you so much!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login