WordPress: Template Tags/the content rss:修订间差异
来自站长百科
无编辑摘要 |
(→用法) |
||
第7行: | 第7行: | ||
== 用法 == | == 用法 == | ||
%%% <?php the_content_rss('more_link_text', strip_teaser, | %%% <?php the_content_rss('more_link_text', strip_teaser,'more_file', cut, encode_html); ?> %%% | ||
==例子 == | ==例子 == | ||
2008年7月17日 (四) 11:48的最新版本
描述[ ]
显示当前文章的内容,形成 RSS格式。必须在The_Loop内使用这个标签。
当在非单一/非permalink文章网页上而且使用了<!--more--> Quicktag时,这个标签会显示一个"teaser"链接,点击链接阅读更多的文章内容。
用法[ ]
%%% <?php the_content_rss('more_link_text', strip_teaser,'more_file', cut, encode_html); ?> %%%
例子[ ]
默认用法[ ]
使用默认设置,将内容显示为RSS格式。
<?php the_content_rss(); ?>
[ ]
将内容以RSS格式显示,隐藏摘录链接并且切断五十个字以后的内容。
<?php the_content_rss('', TRUE, '', 50); ?>
参数[ ]
- more_link_text
- (string) 为"more"链接显示的链接文本。默认为'(more...)'。
- strip_teaser
- (boolean) "more"链接之前的文本应该隐藏(TRUE)还是显示(FALSE)。默认为FALSE。
- more_file
- (string) "more"链接指向的文件。默认为当前文件。
- cut
- (integer) 结束内容之前显示的文字数目。默认为0(显示所有文字)。
- encode_html
- (integer) 定义html标签过滤和特别的字符(例如'&')编码。选项是:
- 0 - (默认)为有限的"url 脚注"Parses out链接。
- 1 - 过滤PHP 函数htmlspecialchars(),但是同时设置cut to 0,这样使用cut参数时,就不会推荐了。
- 2 - 剥除html标签,而不将'&'替换为HTML等同的实体(&)。当使用cut参数时,这是默认的。
相关的[ ]
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,