View Single Post
Old 01-03-2012, 11:23 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,588
if you wannna show the start year, as well as the current year this should do it.

Code:
<?php 

function custom_copyright() { 
    global $wpdb; 
    $copyright_dates = $wpdb->get_results("SELECT YEAR(min(post_date_gmt)) AS firstdate, YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts WHERE post_status = 'publish'"); 
    $output = ''; 
    if($copyright_dates) { 
        $copyright = "&copy; " . $copyright_dates[0]->firstdate; 
        if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { 
            $copyright .= '-' . $copyright_dates[0]->lastdate; 
        } 
        $output = $copyright; 
    } 
    return $output; 
}
__________________
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