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

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

美化版:

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

原版:

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

教程:添加加强文本小工具,把下面代码丢进去即可,改一下博客运转时间。

代码:

 

    <div class=”table-r”>    
    <table width=”100%”>    
        <tbody>    
    <tr>   
    <td style=”text-align:center;” width=”50%”><i class=”iconfont icon-xinwen”></i>&nbsp页面查询:</td>    
        <td style=”text-align:center;” width=”50%”><?php echo get_num_queries(); ?>次</td>  </tr><tr>  
    <td style=”text-align:center;” width=”50%”><i class=”iconfont icon-xinwen”></i>&nbsp页面生成:</td>    
        <td style=”text-align:center;” width=”50%”><?php timer_stop(3); ?>秒  
    </td>    
              </tr>    
            <tr>    
                <td style=”text-align:center;” width=”50%”><i class=”iconfont icon-activity”></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=”iconfont icon-liuyan”></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=”iconfont icon-bianji”></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=”iconfont icon-shouye”></i>平安运转:</td>    
        <td style=”text-align:center;” width=”50%”><?php echo floor((time()-strtotime(“2016-5-6″))/86400); ?> 天</td>    
    </tr><tr>    
        <td style=”text-align:center;” width=”50%”><i class=”iconfont icon-weiyuqiang-“></i>&nbsp阅读总量:</td>    
        <td style=”text-align:center;” width=”50%”><?php echo all_view(); ?> 次</td>    
    </tr>  
        <td style=”text-align:center;” width=”50%”><i class=”iconfont icon-xinwen”></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>   
      
        </tbody>    
    </table>    
    </div>    
------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞6赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片