分类
結繩記事

footer的自动版权信息部分

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]

小雪

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

发表评论