A Simple Jquery Year. Because Updating That Shit All The Time Is Dumb.

Home » A Simple Jquery Year. Because Updating That Shit All The Time Is Dumb.

by | Nov 20, 2022

Home » A Simple Jquery Year. Because Updating That Shit All The Time Is Dumb.

A static-text Copyright year. Holy crap is that annoying, worse when you see it on WordPress or any other website worth having for that matter. It is an even bigger sin when there is no footer on the page template and that 4 digit monstrosity is slapped in some banana bread-ass page builder x 25 pages… I’ve been there.

– right eye twitches subtly

So you need to put one of those hokey years at the bottom of your website and want to make people believe its updated every year.

Do you want to do it?… No.

Do you think the client can?…

Let’s be honest here, most people who don’t make websites for a living remember absolutely nothing about how a website you made for them works. You give some of them clear instructions and they will go full Running of The Bulls across the home page & default settings before contacting you at 8pm.

Anyhow, rant over, you want the code:

<script type="text/javascript">
$( document ).ready(function() {
$('.fyr').text( new Date().getFullYear() );

That goes in your <head> or <footer> of your website. Some WordPress will not let you use $ for jQuery so instead replace $ with jQuery like so:

<script type="text/javascript">
jQuery( document ).ready(function() {
jQuery('.fyr').text( new Date().getFullYear() );

After that you just stick a span where you want that year to go with that same class, or change the class do whatever you want:

<span class="fyr"></span>

If you have a dog shit theme and you cant stick code in your header or footer easily you have three options:

  1. Throw it away
  2. Child theme and use a function
  3. Use a plugin

Throw it away

I do not like bad themes. nope nope nope. This is my go-to. Do it well from the start.

Child-Theme and use a function

Child theme configurator will make boss child themes fast. That is something you don’t want to waste your time with and you can disable the plugin once done. If you want to be an absolute Chad of a minimalist in WordPress, Slap this in your functions.php:

/* Describe what the code snippet does so you can remember later on */
add_action('wp_footer', 'your_function_name');
function your_function_name(){

Replace the obvious shit where it’s obvious.

Use a Plugin

You don’t care about overhead, or your time to memory/keystroke ratio is not in the favor of php resource optimization. you can grab Header/Footer Code Manager. Sometimes this is ideal because you might be slapping those dang analytics and tag manager scripts in specific places and that plugin has a very nice management system.

Well that should do it, if you found this confusing, I’m sorry, have you turned it off an on again?💀


This is the end of the page. I bet you expected more. Well, here is the sitemap and a year that updates with a simple js script.

| sitemap