仅供参考,这里还有一个功能可以用来显示版权信息
function wpse_copyright_in_footer() {
$all_posts = get_posts(\'post_status=publish&order=ASC\');
$first_post = $all_posts[0];
$first_date = $first_post->post_date_gmt;
_e(\'Copyright © \');
if ( substr($first_date,0,4) == date(\'Y\') ) {
echo date(\'Y\');
} else {
echo substr($first_date,0,4) . "-" . date(\'Y\');
}
echo \' <strong>\' . get_bloginfo(\'name\') . \'</strong> \';
}
然后,您可以在页脚中这样简单地调用它。php
<?php echo wpse_copyright_in_footer(); ?>