把下面这个代码放在 e/class/userfun.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;
}
调用代码:
<?php echo count_words_read_time(); ?>
感谢您的来访,获取更多精彩文章请收藏本站。
© 版权声明
THE END

















暂无评论内容