最新公告
  • 欢迎您光临袁博客,本站秉承服务宗旨 履行“站长”责任,做国内最专业的站长资源平台!立即加入我们
  • WordPress添加网站文章内容页字数统计代码

    wordpress 文章字数统计功能,很简单,而且和 icrosoft Word 统计的字数完全一致。中英文代码统计中都没有出现问题,可以说是一段标准的内容统计代码,简约高效。之所以能有今天的这个方法,还要得益于 wordpress 的强大,既然在后台上可以看到字数的统计功能,那么在前台又为何不能实现?貌似只要知道一点点调用的方法就 OK 了吧?接下来柠檬教大家如何实现!

    核心代码

    将下面代码复制到 wp 主题的 functions.php 文件里:

    //字数统计
    function count_words ($text) {
    global $post;
    if ( \'\' == $text ) {
       $text = $post->post_content;
       if (mb_strlen($output, \'UTF-8\') < mb_strlen($text, \'UTF-8\')) $output .= \'本文共计有\' . mb_strlen(preg_replace(\'/\\s/\',\'\',html_entity_decode(strip_tags($post->post_content))),\'UTF-8\') . \'个字\';
       return $output;
    }
    }
    

    调用代码

    <?php echo count_words ($text); ?>
    

    放在文章配置文件(合适的位置就可以了)测试中文统计正常,英文统计字母。
    WordPress添加文章字数统计代码-路途吧

    1、本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
    2、分享目的仅供大家学习和交流,请不要用于商业用途!
    3、本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
    4、如有链接无法下载、失效或广告,请联系管理员处理!
    5、本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
    6、联系微信:A2022717!

    袁博客 » WordPress添加网站文章内容页字数统计代码

    常见问题FAQ

    免费下载或者VIP会员专享资源能否直接商用?
    本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
    提示下载完但解压或打开不了?
    最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用百度网盘软件或迅雷下载。 若排除这种情况,可在对应资源底部留言,或 联络我们.。
    你们有qq群吗怎么加入?
    当然有的,如果你是帝国cms、易优cms、和pbootcms系统的爱好者你可以加入我们的QQ千人交流群https://www.932t.com/page-qun.html。

    10 评论

    1. lasix without prescription Participants primarily reported taking non prescription sleep aids containing diphenhydramine and doxylamine, which the Beers Criteria for Potentially Inappropriate Medication Use in Older Adults strongly recommends avoidance of due to possible harmful effects

    2. However, the role of TRAF6 autoubiquitination is unclear since reconstitution of TRAF6 deficient MEFs with a TRAF6 lysine deficient mutant rescues IL 1 and RANK induced NF ОєB activation similar to wild type TRAF6 51 stromectol buy online itraconazole will increase the level or effect of enzalutamide by affecting hepatic intestinal enzyme CYP3A4 metabolism

    3. Freeman zNadAHNaeWSvKg 5 19 2022 clomid However, the mechanism of action of these factors for ER mediated transcription is not completely understood

    4. lasix and hyponatremia Somewhere between 15 and 25 percent of patients get significant muscle aches and joint aches with aromatase inhibitors

    5. There was no difference with regards to median age at the time of diagnosis or years of tamoxifen exposure buy nolvadex for lab rats

    6. Suitable monovalent substituents on a substitutable carbon atom of an optionally substituted group are independently halogen; CH 2 0 4 R; CH 2 0 4 OR; O CH 2 0 4 R, O CH 2 0 4 C O OR; CH 2 0 4 CH OR 2; CH 2 0 4 SR; CH 2 0 4 Ph, which may be substituted with R; CH 2 0 4 O CH 2 0 1 Ph which may be substituted with R; CH CHPh, which may be substituted with R; CH 2 0 4 O CH 2 0 1 pyridyl which may be substituted with R; NO 2; CN; N 3; CH 2 0 4 N R 2; CH 2 0 4 N R C O R; N R C S R; CH 2 0 4 N R C O NR 2; N R C S NR 2; CH 2 0 4 N R C O OR; N R N R C O R; N R N R C O NR 2; N R N R C O OR; N R C NR N R 2; CH 2 0 4 C O R; C S R; CH 2 0 4 C O OR; CH 2 0 4 C O SR; CH 2 0 4 C O OSiR 3; CH 2 0 4 OC O R; OC O CH 2 0 4 SR; SC S SR; CH 2 0 4 SC O R; CH 2 0 4 C O NR 2; C S NR 2; C S SR; SC S SR, CH 2 0 4 OC O NR 2; C O N OR R; C O C O R; C O CH 2 C O R; C NOR R; CH 2 0 4 SSR; CH 2 0 4 S O 2 R; CH 2 0 4 S O 2 OR; CH 2 0 4 OS O 2 R; S O 2 NR 2; CH 2 0 4 S O R; N R S O 2 NR 2; N R S O 2 R; N OR R; C NH NR 2; P O 2 R; P O R 2; OP O R 2; OP O OR 2; SiR 3; C 1 4 straight or branched alkylene O N R 2; or C 1 4 straight or branched alkylene C O O N R 2, wherein each R may be substituted as defined below and is independently hydrogen, C 1 6 aliphatic, CH 2 Ph, O CH 2 0 1 Ph, CH 2 5 6 membered heteroaryl ring, or a 5 6 membered saturated, partially unsaturated, or aryl ring having 0 4 heteroatoms independently selected from nitrogen, oxygen, or sulfur, or, notwithstanding the definition above, two independent occurrences of R, taken together with their intervening atom s, form a 3 12 membered saturated, partially unsaturated, or aryl mono or bicyclic ring having 0 4 heteroatoms independently selected from nitrogen, oxygen, or sulfur, which may be substituted as defined below 60mg priligy Several studies demonstrated consistently lower seroconversion rates for patients with haematological malignancies compared with patients with solid tumours

    7. stromectol side effects It is highly expressed in blastocysts and its deletion leads to peri implantation lethality

    8. Ingredients In The Drug Keflex stromectol 6mg

    发表评论

    • 1130会员数(个)
    • 3213资源数(个)
    • 1本周更新(个)
    • 0 今日更新(个)
    • 342稳定运行(天)