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]

  1. $before标题前的字符
  2. $after标题后的字符
  3. $echo显示、还是返回字符串,默认为true
[pcsh lang="php" tab_size="4" message="" hl_lines="" provider="manual"]
<?php $myTitle =  get_the_title($ID); ?>
[/pcsh]