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

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == Description == Displays the content of the current post formatted for RSS. This tag must be within WordPress:The_Loop. This tag will display a "teaser"...)
 
无编辑摘要
第1行: 第1行:
== Description ==
== Description ==
== 描述 ==


Displays the content of the current post formatted for [[WordPress:Glossary#RSS|RSS]]. This tag must be within [[WordPress:The_Loop]].
Displays the content of the current post formatted for [[WordPress:Glossary#RSS|RSS]]. This tag must be within [[WordPress:The_Loop]].
显示当前文章的内容,形成 [[WordPress:Glossary#RSS|RSS]]格式。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。


This tag will display a "teaser" link to read more of a post, when on non-single/non-[[WordPress:Glossary#Permalink|permalink]] post pages and the <tt>&lt;!--more--&gt;</tt> Quicktag is used.
This tag will display a "teaser" link to read more of a post, when on non-single/non-[[WordPress:Glossary#Permalink|permalink]] post pages and the <tt>&lt;!--more--&gt;</tt> Quicktag is used.
当在非单一/非[[WordPress:Glossary#Permalink|permalink]]文章网页上而且使用了<tt>&lt;!--more--&gt;</tt> Quicktag时,这个标签会显示一个"teaser"链接,点击链接阅读更多的文章内容。


== Usage ==
== Usage ==
== 用法 ==
%%% <?php the_content_rss('more_link_text', strip_teaser,
                      'more_file', cut, encode_html); ?> %%%


%%% <?php the_content_rss('more_link_text', strip_teaser,
%%% <?php the_content_rss('more_link_text', strip_teaser,
第11行: 第22行:


== Examples ==
== Examples ==
==例子 ==


=== Default Usage ===
=== Default Usage ===
=== 默认用法 ===


Displays the content in RSS format using defaults.
Displays the content in RSS format using defaults.
使用默认设置,将内容显示为RSS格式。
  <?php the_content_rss(); ?>


  <?php the_content_rss(); ?>
<?php the_content_rss(); ?>


=== Hides Teaser Link and Limits Content ===
=== Hides Teaser Link and Limits Content ===
=== 隐藏 Teaser链接和有限的内容===


Displays the content in RSS format, hides the teaser link and cuts the content after 50 words.
Displays the content in RSS format, hides the teaser link and cuts the content after 50 words.
将内容以RSS格式显示,隐藏摘录链接并且切断五十个字以后的内容。
  <?php the_content_rss(&#39;&#39;, TRUE, &#39;&#39;, 50); ?>


   <?php the_content_rss(&#39;&#39;, TRUE, &#39;&#39;, 50); ?>
   <?php the_content_rss(&#39;&#39;, TRUE, &#39;&#39;, 50); ?>


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


; more_link_text : (''string'') Link text to display for the "more" link. Defaults to <tt>'(more...)'</tt>.
; more_link_text : (''string'') Link text to display for the "more" link. Defaults to <tt>'(more...)'</tt>.
; more_link_text : (''string'')为"more"链接显示的链接文本。默认为<tt>'(more...)'</tt>。
; strip_teaser : (''boolean'') Should the text before the "more" link be hidden (<tt>TRUE</tt>) or displayed (<tt>FALSE</tt>). Defaults to <tt>FALSE</tt>.
; strip_teaser : (''boolean'') Should the text before the "more" link be hidden (<tt>TRUE</tt>) or displayed (<tt>FALSE</tt>). Defaults to <tt>FALSE</tt>.
; strip_teaser : (''boolean'') "more"链接之前的文本应该隐藏(<tt>正确的</tt>)还是显示(<tt>错误的</tt>)。默认为<tt>错误的</tt>。
; more_file : (''string'') File which the "more" link points to. Defaults to the current file.
; more_file : (''string'') File which the "more" link points to. Defaults to the current file.
; more_file : (''string'') "more"链接指向的文件。默认为当前文件。
; cut : (''integer'') Number of words displayed before ending content. Default is <tt>0</tt> (display all).
; cut : (''integer'') Number of words displayed before ending content. Default is <tt>0</tt> (display all).
; 切断 : (''整数'')结束内容之前显示的文字数目。默认为<tt>0</tt>(显示所有文字)。
; 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 脚注"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(),但是同时设置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;)。当使用cut参数时,这是默认的。


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


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


{{PHP Function Tag Footer}}
{{PHP Function Tag Footer}}
{{标签文章标签}}
{{PHP函数标签页底文字}}

2008年7月9日 (三) 15:36的版本

Description

描述

Displays the content of the current post formatted for RSS. This tag must be within WordPress:The_Loop.

显示当前文章的内容,形成 RSS格式。必须在The Loop内使用这个标签。

This tag will display a "teaser" link to read more of a post, when on non-single/non-permalink post pages and the <!--more--> Quicktag is used.

当在非单一/非permalink文章网页上而且使用了<!--more--> Quicktag时,这个标签会显示一个"teaser"链接,点击链接阅读更多的文章内容。

Usage

用法

%%% <?php the_content_rss('more_link_text', strip_teaser,

                     'more_file', cut, encode_html); ?> %%%

%%% <?php the_content_rss('more_link_text', strip_teaser,

                     'more_file', cut, encode_html); ?> %%%

Examples

例子

Default Usage

默认用法

Displays the content in RSS format using defaults. 使用默认设置,将内容显示为RSS格式。

 <?php the_content_rss(); ?>

<?php the_content_rss(); ?>

Hides Teaser Link and Limits Content

隐藏 Teaser链接和有限的内容

Displays the content in RSS format, hides the teaser link and cuts the content after 50 words. 将内容以RSS格式显示,隐藏摘录链接并且切断五十个字以后的内容。

 <?php the_content_rss('', TRUE, '', 50); ?>
 <?php the_content_rss('', TRUE, '', 50); ?>

Parameters

参数

more_link_text
(string) Link text to display for the "more" link. Defaults to '(more...)'.
more_link_text
(string)为"more"链接显示的链接文本。默认为'(more...)'
strip_teaser
(boolean) Should the text before the "more" link be hidden (TRUE) or displayed (FALSE). Defaults to FALSE.
strip_teaser
(boolean) "more"链接之前的文本应该隐藏(正确的)还是显示(错误的)。默认为错误的
more_file
(string) File which the "more" link points to. Defaults to the current file.
more_file
(string) "more"链接指向的文件。默认为当前文件。
cut
(integer) Number of words displayed before ending content. Default is 0 (display all).
切断
(整数)结束内容之前显示的文字数目。默认为0(显示所有文字)。
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 脚注"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(),但是同时设置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;)。当使用cut参数时,这是默认的。

Related

相关的

模板:Tag Post Tags

模板:PHP Function 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,