WordPresss主题ripro添加统计模块教程(美化篇)

WordPresss主题ripro添加统计模块教程(美化篇)-99资源网
WordPresss主题ripro添加统计模块教程(美化篇)
站长亲测!
3
您当前未登录!建议登陆后购买,可保存购买订单
付费阅读


1. ripro – > parts -> home-mode 目录新建 census.php 文件,并添加如下代码

<?php
$count_posts = wp_count_posts();
$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
ob_start(); ?>
<div class="section text-center pb-0" style="padding-top:20px; height:75px;">
  <div class="container">
    <div class="alert alert-modern alert-dark">
      <div class="alert-content">
        <span class="type_icont_2"><i class="fa fa-bell-o"></i> 博主统计</span>
        <span class="description-17codesign">
          <p>  资源总数:<?php echo $published_posts = $count_posts->publish;?>个   ๑   注册用户:<?php echo $users; ?>位   ๑   本周更新:<?php echo get_week_post_count(); ?>篇   ๑   今日更新:<?php echo WeeklyUpdate();?>篇  </p>
        </span>
      </div>
    </div>
  </div>
</div>

2.ripro -> parts – home-mode -catbox2.php 在 “ob_start();”前添加如下代码

$count_posts = wp_count_posts();
$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");

3. ripro -> parts – home-mode -catbox2.php 在 “

<div class=”section bgcolor-fff”>

”前添加如下代码

<div class="section text-center pb-0" style="padding-top:20px; height:75px;">
  <div class="container">
    <div class="alert alert-modern alert-dark">
      <div class="alert-content">
        <span class="type_icont_2"><i class="fa fa-bell-o"></i> 博主统计</span>
        <span class="description-17codesign">
          <p>  资源总数:<?php echo $published_posts = $count_posts->publish;?>个   ๑   注册用户:<?php echo $users; ?>位   ๑   本周更新:<?php echo get_week_post_count(); ?>篇   ๑   今日更新:<?php echo WeeklyUpdate();?>篇  </p>
        </span>
      </div>
    </div>
  </div>
</div>

4. ripro -> functions.php 文件,在最后添加如下代码

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享
评论 抢沙发

请登录后发表评论