the_content

函数
the_content ( $more_link_text = null, $strip_teaser = false )
参数
  • (string) $more_link_text Optional. Content for when there is more text.
    Required:
    Default: null
  • (bool) $strip_teaser Optional. Strip teaser content before the more text. Default false.
    Required:
    Default: false
定义位置
相关方法
the_content_rssget_the_contentthe_commentthe_content_feedget_the_content_feed
引入
0.71
弃用
-

the_content – 这个函数用来显示一个文章或页面的内容。它需要几个参数,允许自定义输出,如摘录的长度和是否显示图片或视频。

显示文章的内容。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function the_content( $more_link_text = null, $strip_teaser = false ) {
$content = get_the_content( $more_link_text, $strip_teaser );
/**
* Filters the post content.
*
* @since 0.71
*
* @param string $content Content of the current post.
*/
$content = apply_filters( 'the_content', $content );
$content = str_replace( ']]>', ']]>', $content );
echo $content;
}
function the_content( $more_link_text = null, $strip_teaser = false ) { $content = get_the_content( $more_link_text, $strip_teaser ); /** * Filters the post content. * * @since 0.71 * * @param string $content Content of the current post. */ $content = apply_filters( 'the_content', $content ); $content = str_replace( ']]>', ']]>', $content ); echo $content; }
function the_content( $more_link_text = null, $strip_teaser = false ) {
	$content = get_the_content( $more_link_text, $strip_teaser );

	/**
	 * Filters the post content.
	 *
	 * @since 0.71
	 *
	 * @param string $content Content of the current post.
	 */
	$content = apply_filters( 'the_content', $content );
	$content = str_replace( ']]>', ']]>', $content );
	echo $content;
}

常见问题

FAQs
查看更多 >