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.
Usage
%%%<?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:
%%%<?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)
%%%