Custom WordPress shortcode to display current year
Comment are off
Place this code in your theme’s functions.php file to address that pesky problem of copyright dates in the footer not having the current year displayed!!
/* shortcode for the current year */ function year_shortcode() { $year = date('Y'); return $year; } add_shortcode('year', 'year_shortcode');
So your copyright date in your theme’s footer might look something like this…
Usage:
Copyright © [year] Company Name, Inc.
Displays:
Copyright © 2014 Company Name, Inc.