等信息。
如果想去掉版本号显示,编辑主题的header.php
,将:
<?php $this->header(Content::exportGeneratorRules($this)); ?>
更改为:
<?php $this->header('wlw=&xmlrpc=&rss2=&atom=&rss1=&template=&pingback=&generator'); ?>
在主题的functions.php
文件中加入以下代码:
function timer_start() {
global $timestart;
$mtime = explode( ' ', microtime() );
$timestart = $mtime[1] + $mtime[0];
return true;
}
timer_start();
function timer_stop( $display = 0, $precision = 3 ) {
global $timestart, $timeend;
$mtime = explode( ' ', microtime() );
$timeend = $mtime[1] + $mtime[0];
$timetotal = number_format( $timeend - $timestart, $precision );
$r = $timetotal < 1 ? $timetotal * 1000 . " ms" : $timetotal . " s";
if ( $display ) {
echo $r;
}
return $r;
}
然后在需要显示加载耗时的地方(如footer.php
)插入代码:
<?php echo timer_stop();?>
在主题的functions.php
文件中加入以下代码:
function theAllViews()
{
$db = Typecho_Db::get();
$row = $db->fetchAll('SELECT SUM(VIEWS) FROM `typecho_contents`');
echo number_format($row[0]['SUM(VIEWS)']);
}
然后在需要显示访客总数的地方(如footer.php
)插入代码:
<?php theAllViews(); ?>
您即将前往外部网站:
外部网站的内容不受本站控制,请注意保护您的隐私和安全。