WordPress: Template Tags/the excerpt rss:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == 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...)
 
无编辑摘要
第1行: 第1行:
== Description ==
== Description ==
== 描述 ==


Displays the excerpt of the current post formatted for [[WordPress:Glossary#RSS|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]].
Displays the excerpt of the current post formatted for [[WordPress:Glossary#RSS|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]].
显示当前文章的摘录,为[[WordPress:Glossary#RSS|RSS]]格式。如果你的确提供了一篇清晰明了的文章摘录(在文章编辑器的可选择的摘录区),标签会显示[[WordPress:Glossary#Excerpt|teaser]],使用了文章内容的前55个字。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。


For finer control over output, see [[WordPress:Template Tags/the content rss|the_content_rss()]].
For finer control over output, see [[WordPress:Template Tags/the content rss|the_content_rss()]].
要更好地控制结果,请看看[[WordPress:Template Tags/the content rss|the_content_rss()]]。


== Usage ==
== Usage ==
== 用法 ==
%%% <?php the_excerpt_rss(); ?> %%%


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


See [[WordPress:#Parameters for 1.2|Parameters for 1.2]] for arguments available in that version.
See [[WordPress:#Parameters for 1.2|Parameters for 1.2]] for arguments available in that version.
请看看[[WordPress:#Parameters for 1.2| 1.2版本的参数]],关于1.2版本拥有的参数。


== Example ==
== Example ==
==例子 ==


Displays the post's excerpt, or the first 120 words of the post's content when no excerpt exists, formatted for RSS syndication.
Displays the post's excerpt, or the first 120 words of the post's content when no excerpt exists, formatted for RSS syndication.
显示文章的摘录,或者不存在摘录的时候,显示文章内容的前120个单词,格式为RSS syndication。


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


== Parameters ==
== Parameters ==
== 参数 ==


This tag has no parameters.
This tag has no parameters.
这个标签没有参数。


=== Parameters for 1.2 ===
=== Parameters for 1.2 ===
=== 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.
WordPress version 1.5 does not support parameters for this tag. The following information is retained for the benefit of 1.2 users.
WordPress1.5版本不提供这个标签的参数。下面的信息是为1.2版本的用户,保留的。


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


'''Parameters:'''
'''Parameters:'''
'''参数:'''
; cut : (''integer'') Number of words to display before ending the excerpt. Can be any numeric value up to the default.
; 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:
; encode_html : (''integer'') Defines html tag filtering and special character (e.g. '&') encoding. Options are:
; encode_html : (''整数'')定义html标签过滤和特殊的字符(例如. '&')编码。选项是:
:* <tt>0</tt> - (Default) Parses out links for numbered "url footnotes".
:* <tt>0</tt> - (Default) Parses out links for numbered "url footnotes".
:* <tt>0</tt> - (默认)为有限的  "url footnotes"Parses out链接。
:* <tt>1</tt> - Filters through the [[WordPress:Glossary#PHP|PHP]] function htmlspecialchars(), but also sets cut to <tt>0</tt>, so is not recommended when using the cut parameter.
:* <tt>1</tt> - Filters through the [[WordPress:Glossary#PHP|PHP]] function htmlspecialchars(), but also sets cut to <tt>0</tt>, so is not recommended when using the cut parameter.
:* <tt>1</tt> -过滤[[WordPress:Glossary#PHP|PHP]] 函数htmlspecialchars(),但是同时set cut to <tt>0</tt>,这样使用cut参数时,不会推荐。
:* <tt>2</tt> - Strips html tags, and replaces '&' with [[WordPress:Glossary#HTML|HTML]] entity equivalent (&amp;amp;). This is the default when using the cut parameter.
:* <tt>2</tt> - Strips html tags, and replaces '&' with [[WordPress:Glossary#HTML|HTML]] entity equivalent (&amp;amp;). This is the default when using the cut parameter.
:* <tt>2</tt> -剥除html标签,并且将'&'替换为[[WordPress:Glossary#HTML|HTML]]等同实体(&amp;amp;)。使用切断参数时,这是默认的。


== Related ==
== Related ==
== 相关的==


{{Tag Post Tags}}
{{Tag Post Tags}}


{{No Param Tag Footer}}
{{No Param Tag Footer}}
{{标签文章标签}}
{{没有Param标签页底文字}}

2008年7月9日 (三) 17:33的版本

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.

显示当前文章的摘录,为RSS格式。如果你的确提供了一篇清晰明了的文章摘录(在文章编辑器的可选择的摘录区),标签会显示teaser,使用了文章内容的前55个字。必须在The Loop内使用这个标签。

For finer control over output, see the_content_rss().

要更好地控制结果,请看看the_content_rss()

Usage

用法

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

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

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

请看看[[WordPress:#Parameters for 1.2| 1.2版本的参数]],关于1.2版本拥有的参数。

Example

例子

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

显示文章的摘录,或者不存在摘录的时候,显示文章内容的前120个单词,格式为RSS syndication。

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

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

Parameters

参数

This tag has no parameters.

这个标签没有参数。

Parameters for 1.2

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.

WordPress1.5版本不提供这个标签的参数。下面的信息是为1.2版本的用户,保留的。

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

用法: %%% <?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:
encode_html
(整数)定义html标签过滤和特殊的字符(例如. '&')编码。选项是:
  • 0 - (Default) Parses out links for numbered "url footnotes".
  • 0 - (默认)为有限的 "url footnotes"Parses out链接。
  • 1 - Filters through the PHP function htmlspecialchars(), but also sets cut to 0, so is not recommended when using the cut parameter.
  • 1 -过滤PHP 函数htmlspecialchars(),但是同时set cut to 0,这样使用cut参数时,不会推荐。
  • 2 - Strips html tags, and replaces '&' with HTML entity equivalent (&amp;). This is the default when using the cut parameter.
  • 2 -剥除html标签,并且将'&'替换为HTML等同实体(&amp;)。使用切断参数时,这是默认的。

Related

相关的

模板:Tag Post Tags

模板:No Param Tag Footer

the_ID, the_title, the_title_attribute, single_post_title, the_title_rss, the_content, the_content_rss, the_excerpt, the_excerpt_rss, previous_post_link, next_post_link, posts_nav_link, the_meta,

模板:没有Param标签页底文字