WordPress页面加载用时代码

效果

 

代码

在functions.php中加入下面代码

//页面请求次数及打开时间自动检测
function wp_page_speed() {
date_default_timezone_set( get_option( 'timezone_string' ) );
$content .= '';
$content .= timer_stop( $display = 0, $precision = 2 );
$content .= 's';
echo $content;
}

在需要使用的页面引用下面的代码

<?php echo wp_page_speed($content) ?>
上一篇 WordPress网站稳定运行时间代码
下一篇 Aplayer meting.js的使用
距离活动开始
-- 天
:
-- 时
:
-- 分
:
-- 秒
00 : 00 : 00
2026年 10月 1日 星期四

今日时光

00 : 00 :00
已过 0 天 剩余 0 天
0%
目录
涛哥

涛哥管理员

一名95后Java全栈开发程序员,95后技术分享博主,致力于技术分享和个人项目创作

本月创作热力图

少
多