常用函数-wp_trim_excerpt()

0条评论

常用函数-wp_trim_excerpt()

说明

必要时为文章生成内容摘要。

摘要应在55字以内,如果总字数多于该数目,摘要结尾应添加字符串'[...]'。如果少于55个字符,显示摘要全文。

用法

?php wp_trim_excerpt( $text ) ?>

参数

$text

(字符)(必需)摘要。文本为空时生成摘要。如果文本不为空,不缩减文本并将其原样返回。

默认值:None

返回的值

(字符)

摘要

示例

注释

修改记录

自1.5.0版本后

源文件

wp_trim_excerpt() 位于 wp-includes/formatting中。

相关资源

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.