WordPress 中文文档
Function Reference/wp rss
From WordPress Chinese
目录 |
[编辑]
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-functions.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-functions.php'); wp_rss('http://example.com/rss/feed/goes/here', 5); ?> %%%
[编辑]
Parameters
Template:Parameter Template:Parameter
[编辑]
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)
%%%
[编辑]
