Wordpress截断标题。
我有这个工作...但是。
<?php
$thetitle = $post->post_title; /* or you can use get_the_title() */
$getlength = mb_strlen($thetitle);
$thelength = 25;
echo mb_substr($thetitle, 0, $thelength);
if ($getlength > $thelength) echo \"...\";
?>
只需说标题为“嘿,你好吗”,并在“嘿,\”之后将其截短即可。
我要在逗号后和结尾引号之前消除一个空格。
有没有办法做到这一点?否则标题如下:
嘿...
代替:
嘿,...
谢谢
没有找到相关结果
已邀请:
1 个回复
目浆搽
您只需要修剪空白。