WordPress: Function Reference/wp rss:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: ==Description== Retrieves an RSS feed and parses it, then displays it as an unordered list of links. Uses the [http://magpierss.sourceforge.net/ MagpieRSS and RSSCache] functions for par...)
 
无编辑摘要
第1行: 第1行:
==Description==
==Description==
== 描述==


Retrieves an RSS feed and parses it, then displays it as an unordered list of links. Uses the [http://magpierss.sourceforge.net/ MagpieRSS and RSSCache] functions for parsing and automatic caching and the [http://sourceforge.net/projects/snoopy/ Snoopy HTTP client] for the actual retrieval.  
Retrieves an RSS feed and parses it, then displays it as an unordered list of links. Uses the [http://magpierss.sourceforge.net/ MagpieRSS and RSSCache] functions for parsing and automatic caching and the [http://sourceforge.net/projects/snoopy/ Snoopy HTTP client] for the actual retrieval.  
得到RSS feed,对其解析,将其显示为链接的无序列表。使用[http://magpierss.sourceforge.net/ MagpieRSS and RSSCache]函数,为真正的retrieval解析并且自动隐藏和[http://sourceforge.net/projects/snoopy/ Snoopy HTTP client]。


==Usage==
==Usage==
== 用法 ==
%%%<?php
include_once(ABSPATH . WPINC . '/rss.php');
wp_rss($uri, $num);
?> %%%


%%%<?php
%%%<?php
第11行: 第22行:


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


To get and display a list of 5 links from an existing RSS feed:
To get and display a list of 5 links from an existing RSS feed:
从当前的RSS feed中得到并且显示带有五个链接的列表:
%%%<?php
include_once(ABSPATH . WPINC . '/rss.php');
wp_rss('http://example.com/rss/feed/goes/here', 5);
?>
%%%


%%%<?php  
%%%<?php  
第21行: 第41行:


==Parameters==
==Parameters==
== 参数 ==
{{Parameter|$uri|URI|The URI of the RSS feed you want to retrieve. The resulting parsed feed is returned, with the more interesting and useful bits in the items array.}}
{{Parameter|$uri|URI|The URI of the RSS feed you want to retrieve. The resulting parsed feed is returned, with the more interesting and useful bits in the items array.}}
{{Parameter|$uri|URI|你想要得到的RSS feed的URI。返回最后解析后的feed,items数组中有更有趣,更有用的位。}}
{{Parameter|$num|integer|The number of items to display.}}
{{Parameter|$num|integer|The number of items to display.}}
[[WordPress:Category:Functions]]
[[WordPress:Category:Functions]]
{{Parameter|$num|integer|将要显示的items的数目。}}
[[WordPress:Category:Functions|类别:函数]]


==Output==
==Output==
==输出==
The output will look like the following:
The output will look like the following:
输出的内容看起来像:
%%%<ul>
<li>
<a href='LINK FROM FEED' title='DESCRIPTION FROM FEED'>TITLE FROM FEED</a>
</li>
(repeat for number of links specified)
</ul>
%%%


%%%<ul>
%%%<ul>
第37行: 第81行:


== Related ==
== Related ==
==相关的==
[[WordPress:Function_Reference/fetch_rss|fetch_rss]]
[[WordPress:Function_Reference/fetch_rss|fetch_rss]]
[[WordPress:Function_Reference/fetch_rss|fetch_rss]]

2008年7月21日 (一) 10:59的版本

Description

描述

Retrieves an RSS feed and parses it, then displays it as an unordered list of links. Uses the MagpieRSS and RSSCache functions for parsing and automatic caching and the Snoopy HTTP client for the actual retrieval.

得到RSS feed,对其解析,将其显示为链接的无序列表。使用MagpieRSS and RSSCache函数,为真正的retrieval解析并且自动隐藏和Snoopy HTTP client

Usage

用法

%%%<?php include_once(ABSPATH . WPINC . '/rss.php'); wp_rss($uri, $num); ?> %%%

%%%<?php include_once(ABSPATH . WPINC . '/rss.php'); wp_rss($uri, $num); ?> %%%

Example

例子

To get and display a list of 5 links from an existing RSS feed: 从当前的RSS feed中得到并且显示带有五个链接的列表:

%%%<?php include_once(ABSPATH . WPINC . '/rss.php'); wp_rss('http://example.com/rss/feed/goes/here', 5); ?> %%%

%%%<?php include_once(ABSPATH . WPINC . '/rss.php'); wp_rss('http://example.com/rss/feed/goes/here', 5); ?> %%%

Parameters

参数

WordPress:Category:Functions


类别:函数

Output

输出

The output will look like the following:

输出的内容看起来像:

%%%

  • <a href='LINK FROM FEED' title='DESCRIPTION FROM FEED'>TITLE FROM FEED</a>
  • (repeat for number of links specified)

%%%


%%%

  • <a href='LINK FROM FEED' title='DESCRIPTION FROM FEED'>TITLE FROM FEED</a>
  • (repeat for number of links specified)

%%%

Related

相关的

fetch_rss fetch_rss