自定义WordPress标题长度

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了自定义WordPress标题长度相关的知识,希望对你有一定的参考价值。

Must be used in the loop.
  1. // Replace 34 with the number of characters to display.
  2.  
  3. <?php
  4. $title = the_title('','',FALSE);
  5. echo substr($title, 0,34);
  6. if (strlen($title) > 34) echo "...";
  7. ?>

以上是关于自定义WordPress标题长度的主要内容,如果未能解决你的问题,请参考以下文章