WordPress:Function Reference/wp rss
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
参数
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)
%%%