你不想知道你写了多少字的博客吗?

插件简介

  WordsCounter ,一款 Typecho 全站字数统计插件,可设置是否统计隐藏/私有文章字数,通过添加代码可在博客信息中展示出来,效果图:

插件安装

1.前往Github下载插件压缩包。
2.解压文件并重命名为 WordsCounter
3.用宝塔或 putty 等工具将文件夹上传至网站目录./usr/plugins 下;
4.进入网站后台,控制台->插件->启用 WordsCounter
5.点击设置,选择是否统计隐藏文章字数。

添加代码

以 handsome version 7.3.1 Pro 主题为例,仅供参考

./usr/themes/handsome/component/sidebar.php文件中插入以下代码,添加位置:在博客信息字样下,自定义选择显示位置,但注意要在上一个 badge 和下一个 pull-right 之间插入,如图:

 pull-right"><?php WordsCounter_Plugin::allOfCharacters(); ?></span><?php _me("全站字数") ?></li>
<li class="list-group-item text-second"><span class="blog-info-icons"> <i data-feather="calendar"></i></span>
               <span class="badge


添加完毕保存 sidebar.php 文件,刷新网页即可。

Last modification:May 17, 2023
If you think my article is useful to you, please feel free to appreciate