WordPress:Function Reference/wp rss

来自站长百科
Fludlen讨论 | 贡献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