Friday, July 5, 2013

How to add Year Shortcode to your WordPress website

It's very easy,

1) go to Appearance Menu
2) click on Editor
3) click on function.php file (in right side)
4) add this code in this file
function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');
5)Use [year]  shortcode in your posts.
Disqus Comments