WordPress:Template Tags/the excerpt rss

来自站长百科
Xxf3325讨论 | 贡献2008年6月27日 (五) 11:02的版本 (新页面: == Description == Displays the excerpt of the current post formatted for RSS.If you do not provide an explicit excerpt to a post (in the post editor's optional...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

Description

Displays the excerpt of the current post formatted for RSS.If you do not provide an explicit excerpt to a post (in the post editor's optional excerpt field), the first 55 words of the post's content are used. This tag must be within WordPress:The_Loop.

For finer control over output, see the_content_rss().

Usage

%%% <?php the_excerpt_rss(); ?> %%%

See [[WordPress:#Parameters for 1.2|Parameters for 1.2]] for arguments available in that version.

Example

Displays the post's excerpt, or the first 120 words of the post's content when no excerpt exists, formatted for RSS syndication.

<description><?php the_excerpt_rss(); ?></description> 

Parameters

This tag has no parameters.

Parameters for 1.2

WordPress version 1.5 does not support parameters for this tag. The following information is retained for the benefit of 1.2 users.

Usage: %%% <?php the_excerpt_rss(cut, encode_html); ?> %%%

Parameters:

cut
(integer) Number of words to display before ending the excerpt. Can be any numeric value up to the default.
encode_html
(integer) Defines html tag filtering and special character (e.g. '&') encoding. Options are:
  • 0 - (Default) Parses out links for numbered "url footnotes".
  • 1 - Filters through the PHP function htmlspecialchars(), but also sets cut to 0, so is not recommended when using the cut parameter.
  • 2 - Strips html tags, and replaces '&' with HTML entity equivalent (&amp;). This is the default when using the cut parameter.

Related

模板:Tag Post Tags

模板:No Param Tag Footer