给你的WordPress站点添加统计代码,放在你想显示的主题文件中,把CSS代码放入你的主题样式文件里。
<ul class="codesign-footer-ul">
<li class="codeisgn-footer"><h6 class="codesign-h6"><?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish; ?></h6>资源总数</li>
<li class="codeisgn-footer weizhi1"><h6 class="codesign-h6"><?php echo get_week_post_count(); ?></h6>本周更新</li>
<li class="codeisgn-footer weizhi1"><h6 class="codesign-h6"><?php echo WeeklyUpdate(); ?></h6>今日更新</li>
<li class="codeisgn-footer weizhi1"><h6 class="codesign-h6"><?php $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users"); echo $users; ?></h6>会员数量</li>
<li class="codeisgn-footer weizhi1"><h6 class="codesign-h6"><?php $total_comments = get_comment_count(); echo $total_comments['approved'];?></h6>评论总数</li>
</ul>
/* 文字统计排版开始 */
.codesign-footer-ul{
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
padding-left: 0;
}
.codeisgn-footer {
list-style: none;
font-size: 13px;
}
.codesign-h6 {
line-height: 0px !important;
font-size: 20px !important;
margin-right: 30px;
margin-bottom: 10px !important;
font-weight: 700 !important;
color: #f84270;
}
.weizhi1 {
margin-left: 30px;
}
/* 文字统计排版结束 */
声明:本站文章原创有部分资源来源于网络,如无特殊说明或标注。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系 admin@liitk.com 进行删除处理!。
评论(0)