给begin主题博客小工具概况代码美化

教程评论11,9335阅读模式

begin主题博客小工具概况代码美化,原主题的一般般,不适合我的审美,顺便添加了网页查询次数和生成时间,以前好像写过这文章,找不到了重新记录一下。

美化版:

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

我的微信
微信扫一扫
weinxin
我的微信
我的微信公众号
微信扫一扫
weinxin
我的公众号
 最后更新:2021-9-29
  • 本文由 夏沫 发表于 2021年9月22日22:19:34
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
  • 博客小工具
  • begin主题
  • 查询次数
  • 审美
  • 概况代码

发表评论

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

拖动滑块以完成验证