Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Auto-updating copyright year in the footer

Auto-updating copyright year in the footer

Scheduled Pinned Locked Moved General Discussion
7 Posts 4 Posters 230 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zochovsky
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @zochovsky
      you could do that with jQuery and append.

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • dafvD Offline
        dafvD Offline
        dafv
        wrote on last edited by
        #3

        @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/

        1 Reply Last reply
        0
        • arminunruhA Offline
          arminunruhA Offline
          arminunruh
          Global Moderator
          wrote on last edited by arminunruh
          #4

          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>
          
          dafvD 1 Reply Last reply
          0
          • arminunruhA arminunruh

            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>
            
            dafvD Offline
            dafvD Offline
            dafv
            wrote on last edited by
            #5

            @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?

            1 Reply Last reply
            0
            • arminunruhA Offline
              arminunruhA Offline
              arminunruh
              Global Moderator
              wrote on last edited by arminunruh
              #6

              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>
              
              dafvD 1 Reply Last reply
              0
              • arminunruhA arminunruh

                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>
                
                dafvD Offline
                dafvD Offline
                dafv
                wrote on last edited by
                #7

                @arminunruh I think it was because the span tag was empty. It works now!!
                Thank you so much!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                I also code custom websites or custom Lay features.
                💿 Email me here: 💿
                info@laytheme.com

                Before you post:
                1. When using a WordPress Cache plugin, disable it or clear your cache.
                2. Update Lay Theme and all Lay Theme Addons
                3. Disable all Plugins
                4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                This often solves issues you might run into

                When you post:
                1. Post a link to where the problem is
                2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                Online Users
                W
                wyssseb
                A
                alasdair17
                L
                lulu.ask.
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search