Current Year

  • Unknown's avatar

    How do you display the current year on a page? I’d like to pull the current year and subtract a number and display the result so I don’t have to manually update it.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Do you mean showing something like a ‘Copyright 2014’ text where the year automatically updates?

    Normally this requires code that not work because do not allow certain tags on WordPress.com for security reasons including JavaScript, Flash, iframe, form, and input tags. These restrictions are in place to prevent any disruptions in service due to potentially malicious code.

    You can read more about this here:

    Code

  • Unknown's avatar

    Yeah, I was aware of the restrictions on Javascript, etc, but I was hoping there might be a workaround the way there is one to display YouTube videos for example. Thanks for your help!

  • Unknown's avatar

    Maybe we can find a different workaround. Could you explain your idea again in more detail? perhaps with an example.

  • Unknown's avatar

    On my page, I indicate how many years experience each of my instructors has. I was thinking that it would save me the trouble of updating it each year by subtracting the instructor’s starting year from the current year and displaying the result.

  • Unknown's avatar

    I see. That needs to either be done manually or you can write the year they started instead.

  • The topic ‘Current Year’ is closed to new replies.