View Single Post
Old 05-24-2011, 09:23 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,583
for you wp nuts

Code:
<?php
  function wordpress_copyright() {
      global $wpdb;
      $post_datetimes = $wpdb->get_row($wpdb->prepare("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970"));
      if ($post_datetimes) {
          $firstpost_year = $post_datetimes->firstyear;
          $lastpost_year = $post_datetimes->lastyear;
          $copyright = __('Copyright &copy; ') . $firstpost_year;
          if ($firstpost_year != $lastpost_year) {
              $copyright .= '-' . $lastpost_year;
          }
          $copyright .= ' ';
          echo $copyright;
      }
  }
?>
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


My Cam Feeds Script / Gallery Scraper / WPXXX Theme / Free Templates
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote