wordpress get_the_title 和 the_title函数
get_the_title 和 the_title 两个函数用来在文章页面显示文章标题的函数,
the_title 默认直接显示,get_the_title 默认返回字符串
[pcsh lang=”php” tab_size=”4” message=”” hl_lines=”” provider=”manual”]
<?php the_title( $before, $after, $echo ); ?>
[/pcsh]
$before标题前的字符$after标题后的字符$echo显示、还是返回字符串,默认为true
<?php $myTitle = get_the_title($ID); ?>
[/pcsh]
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Dev!