PHP代码:
[code type=php]
-
< ?php
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 = $firstpost_year;
if($firstpost_year != $lastpost_year) {
$copyright .= ‘-‘. $lastpost_year;
}
$copyright .= ‘ ‘;echo $copyright;
}
?>
Theme designed by 你的大名 - Powerd by WordPress
[/code]
CSS代码:
[code type=css]
#copyright { float:left; display:inline; margin:55px 0 0 -10px; color:#777; }
#copyright li { float:left; display:inline; font-size:11px; margin:0 10px 0 0; padding:0 0 0 13px; background:url(img/footer_line.gif) no-repeat left center; }
#copyright li a, #copyright li a:visited { text-decoration:underline; }[/code]
Leave a Reply