知更鸟Begin主题网站统计美化代码

小柒博客 WordPress美化评论159.2K4字数 1845阅读6分9秒阅读模式

     一个简单的功能,博客概况美化?自适应来自鸟叔,图标自己修改,文字自己修改,在鸟叔主题测试可用,别的主题自己测试。

知更鸟Begin主题网站统计美化代码

代码:

<div class="table-r">
<table width="100%">
    <tbody>
        <tr>
            <td style="text-align:center;" width="50%"><i class="zm zm-wenzhang" aria-hidden="true"></i>&nbsp文章总数:</td>
            <td style="text-align:center;" width="50%"><?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish;?> 篇</td>
        </tr>
        <tr>
            <td style="text-align:center;" width="50%"><i class="zm zm-liuyan3" aria-hidden="true"></i>&nbsp留言数量:</td>
            <td style="text-align:center;" width="50%"><?php global $wpdb; echo $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments");?> 条</td>
        </tr>
        <tr>
            <td style="text-align:center;" width="50%"><i class='zm zm-biaoqian'></i>&nbsp标签总数:</td>
            <td style="text-align:center;" width="50%"><?php echo $count_tags = wp_count_terms('post_tag'); ?> 个</td>
        </tr>
        <tr>
            <td style="text-align:center;" width="50%"><i class="zm zm-youlian" aria-hidden="true"></i>&nbsp友链链接:</td>
            <td style="text-align:center;"width="50%"><?php global $wpdb; echo $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links WHERE link_visible = 'Y'"); ?> 个</td><tr>
    <td style="text-align:center;" width="50%"><i class="zm zm-anquanyunhang" aria-hidden="true"></i>
 安全运行:</td>
    <td style="text-align:center;" width="50%"><?php echo floor((time()-strtotime("2017-12-14"))/86400); ?> 天</td>
</tr><tr>
    <td style="text-align:center;" width="50%"><i class="zm zm-liulan" aria-hidden="true"></i>&nbsp浏览总量:</td>
    <td style="text-align:center;" width="50%"><?php echo all_view(); ?> 次</td>
</tr><tr>
    <td style="text-align:center;" width="50%"><i class="zm zm-zuihougengxinshijian" aria-hidden="true"></i>&nbsp最后更新:</td>
    <td style="text-align:center;" width="50%"><?php global $wpdb; $last =$wpdb->get_results("SELECT MAX(post_modified) AS MAX_m FROM $wpdb->posts WHERE (post_type = 'post' OR post_type = 'page') AND (post_status = 'publish' OR post_status = 'private')");$last = date('Y年n月j日', strtotime($last[0]->MAX_m));echo $last; ?></td>
</tr>
        </tr>
    </tbody>
</table>
</div>

若文章图片、下载链接等信息出错,请在评论区留言反馈,博主将第一时间更新!如本文“对您有用”,欢迎随意打赏,谢谢!

继续阅读
Wechat
微信扫一扫,加我!
weinxin
微信公众号
微信扫一扫,关注我!
weinxin
小柒博客
  • 本文由 小柒博客 发表于 2020年4月8日15:12:08
  • 声明:本站所有文章,如无特殊说明或标注,本站文章均为原创。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。转载请务必保留本文链接:https://www.yangxingzhen.com/6701.html
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

拖动滑块以完成验证