Add Dynamic Copyright Year In WordPress

The Enfold Theme has a socket area where it is standard to put copyright information as well as credits. There are some occasions when disclaimers and terms make sense to link to in the footer.

The Enfold Theme doesn’t automatically add the year and instead of adding the year manually, this tutorial shows how to add a line of php code to the functions.php file (in a Child Theme) and place the corresponding shortcode in the socket.

Other items covered is how to remove the standard Kriesi credits and add the Shrein Media link with UTM parameters.

This tutorial assumes that you’re logged into your WordPress installation, and you are using a Child version of the Enfold Theme.Copyright Year PHP & Shortcode


SHORTCODE © [year]

function year_shortcode() {
	$year = date('Y');
	return $year;
}
add_shortcode('year', 'year_shortcode');


Step 1

Navigate to Appearance>Editor and ensure that you are editing Enfold Child and have selected the functions.php file.

Step 2

Paste the year php code in the functions.php file and click update file.Copyright Year PHP & Shortcode

function year_shortcode() {
	$year = date('Y');
	return $year;
}
add_shortcode('year', 'year_shortcode');

Step 3

Navigate to Enfold Child>Footer and locate the Copyright field. Paste the shortcode into Copyright field to add the copyright symbol and the year to the front end of the website.Copyright Year PHP & Shortcode

SHORTCODE © [year]

Step 4

At this point your socket will display © 2018 (or the current year) – You will want to customize the remainder of the socket. Add the name of the company after the year and if you need to display a Shrein Media credit, add the following line:CUSTOMIZE CREDIT

https://www.shreinmedia.com/?utm_source=CLIENT-NAME-HERE&utm_medium=client&utm_campaign=shrein-media-client
HYPERLINKED TEXT

Created by Shrein Media, LLC

Step 5

Enfold Theme places a standard line of code giving a credit to Kriesi. To hide this line of code, add the following to the end of any text in the Copyright field [nolink].