WordPress模板标签the_content用于输出文章内容,需要用在The Loop主循环。
the_content( string $more_link_text = null, bool $strip_teaser = false )
函数参数
$more_link_text
字符串值,默认为空
当使用More标签截断内容时,提供一个字符串作为截断后显示的“阅读全文”链接的锚文本。
$strip_teaser
布尔值,默认值:false
当值为true,且在文章页面使用该函数时,More标签之前的摘要内容不会输出。
函数使用示例
输出当前文章内容并以More标签截断
the_content( sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'beizigen' ), get_the_title() ) );
扩展阅读
the_content()函数位于:wp-includes/post-template.php
相关函数: