• Home
  • Services
    • Websites
    • Mobile Optimized Websites
    • SEO (Search Engine Optimization)
  • Portfolio
  • Blog
  • About
  • Contact
Contact me about your project. Click here!
linkedin
rss
google_plus
email
  • Home
  • Services
    • Websites
    • Mobile Optimized Websites
    • SEO (Search Engine Optimization)
  • Portfolio
  • Blog
  • About
  • Contact

Blog Post

Custom WordPress shortcode to display current year

17 Nov 2014
Comment are off
Eric

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.

About the Author
Eric Hicks is a Freelance Web Developer in Tampa Bay, FL specializing in PHP/MySQL programming, CodeIgniter, and ExpressionEngine, WordPress, Internet Marketing and SEO. Call (813) 418-6833 if you are interested in hiring Eric for your Internet project.

Social Share

  • google-share

Contact

Eric A. Hicks, MBA
Freelance Web Developer
(813) 418-6833
[email protected]
Note: Email is the BEST way to communicate with me!

10736 Doc Brittle St.
New Port Richey, FL 34655

Contact

Eric A. Hicks, MBA
Freelance Web Developer
(813) 418-6833
[email protected]
Note: Email is the BEST way to communicate with me!

10736 Doc Brittle St.
New Port Richey, FL 34655

Recent Posts

  • Delete all messages in your LinkedIn inbox
  • Custom WordPress shortcode to display current year
  • How to quickly add responsive images to WordPress with width:100% CSS set
  • Google Analytics tutorial for business owners
Copyright © Eric A Hicks, LLC