WordPress:Template Tags/the content rss

来自站长百科
Fludlen讨论 | 贡献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,