document.writeln('');

国产精品最大AV站在线观看,a级黄毛片试看三分钟,AV无码A片高潮AV,国产午夜精品一区二区三区,久久爆乳不卡一区,日本三级欧美三级,日韩精品AV一二三区在线,高H短篇小说抽插

當前位置:首頁 > 免費源碼 > 文章頁面添加文章字數和閱讀時間

文章頁面添加文章字數和閱讀時間

游戲科技網2026年09月15日 04:42免費源碼110
美化教程

1、在主題目錄下functions.php文件把下面的代碼添加進去:

// 文章字數和閱讀時間
function count_words_read_time () {
global $post;
$text_num = mb_strlen(preg_replace(/s/,,html_entity_decode(strip_tags($post->post_content))),UTF-8);
$read_time = ceil($text_num/300); // 修改數字300調整時間
$output .= 共計 . $text_num . 字,閱讀大約 . $read_time . 分鐘。;
return $output;
}
//  文章字數和閱讀時間
function count_words_read_time () {
  global $post;
  $text_num = mb_strlen(preg_replace(/s/,,html_entity_decode(strip_tags($post->post_content))),UTF-8);
  $read_time = ceil($text_num/300); // 修改數字300調整時間
  $output .= 共計 . $text_num . 字,閱讀大約 . $read_time  . 分鐘。;
  return $output;
}
//文章字數和閱讀時間function count_words_read_time () {global $post;$text_num = mb_strlen(preg_replace(/s/,,html_entity_decode(strip_tags($post->post_content))),UTF-8);$read_time = ceil($text_num/300); // 修改數字300調整時間$output .= 共計 . $text_num . 字,閱讀大約 . $read_time. 分鐘。;return $output;}

2、在主題目錄zibll/inc/functions/zib-single.php,把下面代碼添加到132行處(如下圖)

<!--文章字數和閱讀時間--><i class="fa fa-hourglass-start"></i> <?php echo count_words_read_time(); ?>
<!--文章字數和閱讀時間--><i class="fa fa-hourglass-start"></i> <?php echo count_words_read_time(); ?>
<!--文章字數和閱讀時間--><i class="fa fa-hourglass-start"></i> <?php echo count_words_read_time(); ?>

說明:(必看)文章字數和閱讀時間都不是很準,同時用處也不是很大…喜歡的話自己拿去試試吧!