wordpress知更鸟begin主题博客概况代码美化记录

wp美化1 146.1K views1阅读模式

美化前后效果对比如下:

wordpress知更鸟begin主题博客概况代码美化记录

把下方代码加在小工具中的增加文本即可实现

  1. <div class="table-r">
  2. <table width="100%">
  3.     <tbody>
  4.         <tr>
  5.             <td style="text-align:center;" width="50%"><i class="iconfont icon-activity"></i>&nbsp文章总数:</td>
  6.             <td style="text-align:center;" width="50%"><?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish;?> 篇</td>
  7.         </tr>
  8.         <tr>
  9.             <td style="text-align:center;" width="50%"><i class="iconfont icon-liuyan"></i>&nbsp留言数量:</td>
  10.             <td style="text-align:center;" width="50%"><?php global $wpdbecho $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments");?> 条</td>
  11.         </tr>
  12.         <tr>
  13.             <td style="text-align:center;" width="50%"><i class="iconfont icon-bianji"></i>&nbsp标签总数:</td>
  14.             <td style="text-align:center;" width="50%"><?php echo $count_tags = wp_count_terms('post_tag'); ?> 个</td>
  15.         </tr>
  16.         <tr>
  17.             <td style="text-align:center;" width="50%"><i class="iconfont icon-friendLink"></i>&nbsp友链链接:</td>
  18.             <td style="text-align:center;"width="50%"><?php global $wpdbecho $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links WHERE link_visible = 'Y'"); ?> 个</td><tr>
  19.     <td style="text-align:center;" width="50%"><i class="iconfont icon-shouye"></i>安全运行:</td>
  20.     <td style="text-align:center;" width="50%"><?php echo floor((time()-strtotime("2016-5-6"))/86400); ?> 天</td>
  21. </tr><tr>
  22.     <td style="text-align:center;" width="50%"><i class="iconfont icon-weiyuqiang-"></i>&nbsp浏览总量:</td>
  23.     <td style="text-align:center;" width="50%"><?php echo all_view(); ?> 次</td>
  24. </tr><tr>
  25.     <td style="text-align:center;" width="50%"><i class="iconfont icon-xinwen"></i>&nbsp最后更新:</td>
  26.     <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>
  27. </tr>
  28.         </tr>
  29.     </tbody>
  30. </table>
  31. </div>

企鹅SEO
  • 本文由 发表于 2019年5月31日 03:15:12
  • 转载请务必保留本文链接:https://www.qieseo.com/1198.html
评论  1  访客  1
    • Vultr VPS
      Vultr VPS 1

      感谢分享

    发表评论