wordpress中对此有特殊的函数处理 如果想加入动态的又比较合规范的页脚版权日期
在你的footer文件中加入如下代码
© 2011 – <?php echo date('Y'); ?> YourSite.com
2 合乎规范的高质量的动态添加方式 (强烈推荐):
?
function comicpress_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 = "© " . $copyright_dates[0]->firstdate; if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { $copyright .= '-' . $copyright_dates[0]->lastdate; } $output = $copyright; } return $output; }?
在footer.php中添加如下代码
<?php echo comicpress_copyright(); ?>
?