【发布时间】:2019-08-01 03:45:45
【问题描述】:
在 WordPress 中,我们使用代码 <?php the_title(); ?> 来显示帖子的标题。现在,我只想在不同的地方显示标题的第一个字母。我该怎么做?
这个我试过了,还是不行:
<?php $my_title = the_title(); ?>
<?php
$first_char = $my_title[0];
echo $first_char;
?>
【问题讨论】:
标签: php wordpress string substr