WordPress输出文章内容标签:the_content

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 "%s"', 'beizigen' ),
	get_the_title()
) );

扩展阅读

the_content()函数位于:wp-includes/post-template.php

相关函数:

原创文章,作者:,如若转载,请注明出处:https://ce.771633.xyz/1538.html

Like (0)
Previous 2025年3月8日
Next 2025年3月8日

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注