Menu

footer的自动版权信息部分

2009/12/10 1 Min Read

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]

Written By

博主小雪出沒於魔都,目前工作是後端程序員,喜歡旅遊,特別是文化歷史遺跡和博物館,一生所愛日本彩虹樂隊 ( L'Arc-en-Ciel) ,家有橘貓朵朵一隻。

Leave a Reply

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注

了解 花開未央 的更多信息

立即订阅以继续阅读并访问完整档案。

Continue reading