davidgagne.net

  • About
  • Archives
  • Twitter
  • Facebook
  • bartender.live
  • GitHub
  • LinkedIn

WordPress Wednesday: How to Display the Age of Your Site

February 25th, 2009 @ 9:15 am PST

WordPressIf you scroll to the bottom of this page, you’ll see that in my footer I display how long I’ve been publishing this site. It’s pretty simple to do this; all you really need is the DateDiff plugin and PHP’s default date() function.


Once you’ve installed DateDiff, just add this code to your footer.php template:

This blog has been online for <?php datediff("2000-3-14","now","y"); ?> years, <?php datediff("2000-3-14","now","ym"); ?> months, and <?php datediff("2000-3-14","now","md"); ?> days.
I have now been blogging here for <? datediff("2000-3-14", date("Y-m-d"), "d"); ?> days.

In case it’s not obvious, you’ll need to replace the “2000-3-14” with the actual date that you started blogging.

More posts tagged:
blogging / plugins / tips / web design / wordpress / wordpresswednesday

More posts categorized:
Web Design

More posts from:
February 2009 / 2009

Post navigation

Previous Post
Previous Post Spaghetti Cat
Next Post
Next Post Post-Workout Power Shake

Search


The North Face

The North Face

The best part about the outdoors? The community it inspires.

  • XPLR PASS

© David Vincent Gagne. All rights reserved. Custom WordPress Theme by Jacket Industries.