WordPress:Function Reference/wp rss

来自站长百科
Xxf3325讨论 | 贡献2008年7月19日 (六) 14:56的版本 (新页面: ==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...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

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

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)

%%%

Related

fetch_rss