Skip to toolbar

Custom Shortcode In WordPress To Add Current Year To Elementor Footer Template

[updated_on]
Share this post:
Share on facebook
Share on twitter
Share on reddit
Share on linkedin
Share on pinterest
Share on digg
Share on stumbleupon
Share on pocket
Share on email
Share on print

Here is the code to copy into your functions.php file or into the My Custom Functions plugin.

Once the code below is in place, put the shortcode [year] wherever you want the current year to appear on your site.

function current_year_shortcode() {
  $year = date('Y');
  return $year;
}
add_shortcode('year', 'current_year_shortcode');
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email

Responses

Your email address will not be published. Required fields are marked *

Do NOT follow this link or you will be banned from the site!