WordPress: Template Tags/the excerpt rss:修订间差异
来自站长百科
无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
== 描述 == | == 描述 == | ||
显示当前文章的摘录,为[[WordPress:Glossary#RSS|RSS]]格式。如果你的确提供了一篇清晰明了的文章摘录(在文章编辑器的可选择的摘录区),标签会显示[[WordPress:Glossary#Excerpt|teaser]],使用了文章内容的前55个字。必须在[[WordPress:The Loop|The_Loop]]内使用这个标签。 | |||
显示当前文章的摘录,为[[WordPress:Glossary#RSS|RSS]]格式。如果你的确提供了一篇清晰明了的文章摘录(在文章编辑器的可选择的摘录区),标签会显示[[WordPress:Glossary#Excerpt|teaser]],使用了文章内容的前55个字。必须在[[WordPress:The Loop| | |||
要更好地控制结果,请看看[[WordPress:Template Tags/the content rss|the_content_rss()]]。 | 要更好地控制结果,请看看[[WordPress:Template Tags/the content rss|the_content_rss()]]。 | ||
== 用法 == | == 用法 == | ||
第17行: | 第9行: | ||
%%% <?php the_excerpt_rss(); ?> %%% | %%% <?php the_excerpt_rss(); ?> %%% | ||
请看看[[#WordPress:Parameters for 1.2| 1.2版本的参数]],关于1.2版本拥有的参数。 | |||
==例子 == | ==例子 == | ||
显示文章的摘录,或者不存在摘录的时候,显示文章内容的前120个单词,格式为RSS syndication。 | 显示文章的摘录,或者不存在摘录的时候,显示文章内容的前120个单词,格式为RSS syndication。 | ||
<description><?php the_excerpt_rss(); ?></description> | <description><?php the_excerpt_rss(); ?></description> | ||
== 参数 == | == 参数 == | ||
这个标签没有参数。 | 这个标签没有参数。 | ||
=== 1.2版本的参数 === | === 1.2版本的参数 === | ||
WordPress1.5版本不提供这个标签的参数。下面的信息是为1.2版本的用户,保留的。 | WordPress1.5版本不提供这个标签的参数。下面的信息是为1.2版本的用户,保留的。 | ||
'''用法:''' | '''用法:''' | ||
%%% <?php the_excerpt_rss(cut, encode_html); ?> %%% | %%% <?php the_excerpt_rss(cut, encode_html); ?> %%% | ||
'''参数:''' | '''参数:''' | ||
; cut : (''integer | ; cut : (''integer'') 在结束摘录之前,需要显示的字数。可以是等于默认值的任何数值。 | ||
: | ; encode_html : (''integer'') 定义html标签过滤和特殊的字符(例如. '&')编码。选项是: | ||
:* <tt>0</tt> - (默认)为有限的 "url footnotes"Parses out链接。 | :* <tt>0</tt> - (默认)为有限的 "url footnotes"Parses out链接。 | ||
:* <tt>1</tt> - 过滤[[WordPress:Glossary#PHP|PHP]] 函数htmlspecialchars(),但是同时set cut to <tt>0</tt>,这样使用cut参数时,不会推荐。 | |||
:* <tt>1</tt> -过滤[[WordPress:Glossary#PHP|PHP]] 函数htmlspecialchars(),但是同时set cut to <tt>0</tt>,这样使用cut参数时,不会推荐。 | |||
:* <tt>2</tt> - 剥除html标签,并且将'&'替换为[[WordPress:Glossary#HTML|HTML]]等同实体(&amp;)。使用切断参数时,这是默认的。 | |||
== 相关的== | == 相关的== | ||
{{标签文章标签}} | {{标签文章标签}} | ||
{{没有Param标签页底文字}} | {{没有Param标签页底文字}} |
2008年7月18日 (五) 16:06的最新版本
描述[ ]
显示当前文章的摘录,为RSS格式。如果你的确提供了一篇清晰明了的文章摘录(在文章编辑器的可选择的摘录区),标签会显示teaser,使用了文章内容的前55个字。必须在The_Loop内使用这个标签。
要更好地控制结果,请看看the_content_rss()。
用法[ ]
%%% <?php the_excerpt_rss(); ?> %%%
请看看 1.2版本的参数,关于1.2版本拥有的参数。
例子[ ]
显示文章的摘录,或者不存在摘录的时候,显示文章内容的前120个单词,格式为RSS syndication。
<description><?php the_excerpt_rss(); ?></description>
参数[ ]
这个标签没有参数。
1.2版本的参数[ ]
WordPress1.5版本不提供这个标签的参数。下面的信息是为1.2版本的用户,保留的。
用法: %%% <?php the_excerpt_rss(cut, encode_html); ?> %%%
参数:
- cut
- (integer) 在结束摘录之前,需要显示的字数。可以是等于默认值的任何数值。
- encode_html
- (integer) 定义html标签过滤和特殊的字符(例如. '&')编码。选项是:
- 0 - (默认)为有限的 "url footnotes"Parses out链接。
- 1 - 过滤PHP 函数htmlspecialchars(),但是同时set cut to 0,这样使用cut参数时,不会推荐。
- 2 - 剥除html标签,并且将'&'替换为HTML等同实体(&)。使用切断参数时,这是默认的。
相关的[ ]
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,