7b2主题没有实时在线人数等的统计数据。本人需要针对7b2主题写了一个插件来实现,有需要的可以下载,使用教程:
1.安装好插件
2. 统计数据不更新
检查数据库表:登录 phpMyAdmin → 找到 wp_stats_baseline 和 wp_stats_daily_increment 表(前缀可能不同)
手动触发增量:编辑 wp_stats_baseline 表的 last_download_update_date 改为昨天,刷新前台
查看增量表:wp_stats_daily_increment 表是否有今日记录(有则说明增量正常)
3. 我把短代码放在文章里大家演示一下:
温馨提示:下载源码前请先查看安装教程,如有问题可联系在线客服~
工作日9:00-18:00 | 响应≤30分钟 | 解决率98%
1437
稳定运营天数
58.6万+
累计下载次数
254
当前在线用户
若主题有自定义 CSS 冲突,可在「外观→自定义→额外 CSS」中添加
.site-notice.notice-gradient { z-index: 9999 !important; }
.stat-container { display: flex !important; gap: 24px !important; }
比如我网站的前端代码【也可自行写样式!
这个版本已修复所有已知语法错误,兼容 PHP 7.0 + 和所有 MySQL 版本,直接按步骤操作即可成功启用!其它主题没有测试过,7b2主题完整无错,
除了短代码实现之外,也可以前端代码这样写放在你想要的地方,比如放在首页广告的地方。添加步骤:b2主题设置-模块管理-首页-添加公告模块,在模块的调用内容里选择自定义,在自定义内容里填写以下内容就可实现。
<div class=”site-notice notice-gradient” style=”max-width: 1200px; margin: 0 auto; padding: 24px 28px; background: linear-gradient(90deg, #f0f9ff, #e6f7ff, #f0f9ff); background-size: 200% 100%; border-radius: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; box-sizing: border-box; transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); animation: gradientFlow 8s infinite linear; box-shadow: 0 2px 12px rgba(66, 153, 225, 0.08);”>
<!– 图标+主提示区(占比自适应) –>
<div style=”display: flex; align-items: center; gap: 20px; flex: 1; min-width: 280px;”>
<!– 图标区域 –>
<div style=”width: 44px; height: 44px; background: linear-gradient(135deg, #4299e1, #3b82f6); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 20px rgba(66, 153, 225, 0.25); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);”>
<i style=”color: white; font-size: 20px; font-weight: 500;”>✦</i>
</div>
<!– 主文字区域 –>
<div>
<p style=”margin: 0; color: #2d3748; font-size: 15px; font-weight: 500; line-height: 1.6; letter-spacing: 0.02em;”>
温馨提示:下载源码前请先查看安装教程,如有问题可联系在线客服~
</p>
<p style=”margin: 4px 0 0 0; color: #718096; font-size: 13px; line-height: 1.5;”>
工作日9:00-18:00 | 响应≤30分钟 | 解决率98%
</p>
</div>
</div>
<!– 统计数据区(横向排列,自适应换行) –>
<div style=”display: flex; gap: 32px; flex-wrap: wrap; padding-left: 16px; border-left: 1px solid rgba(66, 153, 225, 0.15);”>
<!– 运营天数 –>
<div style=”text-align: center;”>
<p style=”margin: 0; color: #4299e1; font-size: 22px; font-weight: 600; line-height: 1.2;”><?php echo do_shortcode(‘1437‘); ?> 天 </p>
<p style=”margin: 4px 0 0 0; color: #718096; font-size: 12px; letter-spacing: 0.03em;”>稳定运营天数</p>
</div>
<!– 总下载数 –>
<div style=”text-align: center;”>
<p style=”margin: 0; color: #3b82f6; font-size: 22px; font-weight: 600; line-height: 1.2;”><?php echo do_shortcode(‘58.6万+‘); ?></p>
<p style=”margin: 4px 0 0 0; color: #718096; font-size: 12px; letter-spacing: 0.03em;”>累计下载次数</p>
</div>
<!– 在线人数 –>
<div style=”text-align: center;”>
<p style=”margin: 0; color: #10b981; font-size: 22px; font-weight: 600; line-height: 1.2;”><?php echo do_shortcode(‘162‘); ?> 人</p>
<p style=”margin: 4px 0 0 0; color: #718096; font-size: 12px; letter-spacing: 0.03em;”>当前在线用户</p>
</div>
</div>
<!– 按钮区(固定靠右,不换行) –>
<a href=”/requests” style=”background: linear-gradient(135deg, #4299e1, #3b82f6); color: white; padding: 10px 24px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 500; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 4px 16px rgba(66, 153, 225, 0.2); position: relative; overflow: hidden; flex-shrink: 0;”>
帮助中心
<span style=”position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: left 0.6s ease;”></span>
</a>
</div>
<style>
@keyframes gradientFlow {
0% { background-position: 0 0; }
100% { background-position: 200% 0; }
}
/* 主体悬浮效果 */
.site-notice.notice-gradient:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(66, 153, 225, 0.15);
}
/* 图标悬浮效果 */
.site-notice.notice-gradient:hover div:first-child div:first-child {
transform: scale(1.15);
box-shadow: 0 6px 24px rgba(66, 153, 225, 0.35);
}
/* 按钮优化 */
.site-notice.notice-gradient a:hover {
background: linear-gradient(135deg, #3b82f6, #2563eb);
box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
transform: translateY(-2px);
}
.site-notice.notice-gradient a:hover span {
left: 100%;
}
/* 数据卡片hover效果 */
.site-notice.notice-gradient .stat-item:hover p:first-child {
transform: scale(1.05);
color: #2563eb;
}
.site-notice.notice-gradient .stat-item p:first-child {
transition: all 0.3s ease;
}
/* 响应式适配(关键优化) */
@media (max-width: 992px) {
.site-notice.notice-gradient {
gap: 20px;
padding: 20px;
}
/* 数据区减少间距 */
.site-notice.notice-gradient .stat-container {
gap: 24px;
}
}
@media (max-width: 768px) {
.site-notice.notice-gradient {
flex-direction: column;
align-items: flex-start;
gap: 16px;
}
/* 取消左侧边框,数据区居中 */
.site-notice.notice-gradient .stat-container {
width: 100%;
border-left: none;
padding-left: 0;
justify-content: space-around;
margin: 8px 0;
}
/* 按钮全屏宽度 */
.site-notice.notice-gradient a {
width: 100%;
text-align: center;
padding: 12px 0;
}
/* 图标+文字区自适应宽度 */
.site-notice.notice-gradient .main-content {
width: 100%;
min-width: auto;
}
}
@media (max-width: 480px) {
.site-notice.notice-gradient .stat-container {
gap: 16px;
justify-content: space-between;
}
.site-notice.notice-gradient .stat-item p:first-child {
font-size: 18px;
}
.site-notice.notice-gradient .stat-item p:last-child {
font-size: 11px;
}
}
</style>
复制粘贴到你要显示的地方,就能看到和我一样的效果了。
短代码我只能载图展示,放代码就变成在文章里演示了:如下图:
![]()

