WordPress: Function Reference/wp rss:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: ==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...)
 
无编辑摘要
 
(未显示另一用户的1个中间版本)
第1行: 第1行:
==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 parsing and automatic caching and the [http://sourceforge.net/projects/snoopy/ Snoopy HTTP client] for the actual retrieval.
得到RSS feed,对其解析,将其显示为链接的无序列表。使用[http://magpierss.sourceforge.net/ MagpieRSS and RSSCache]函数,为真正的retrieval解析并且自动隐藏和[http://sourceforge.net/projects/snoopy/ Snoopy HTTP client]
 
==Usage==


== 用法 ==
%%%<?php
%%%<?php
include_once(ABSPATH . WPINC . '/rss.php');
include_once(ABSPATH . WPINC . '/rss.php');
wp_rss($uri, $num);
wp_rss($uri, $num);
?> %%%
?> %%%
== 例子 ==


==Example==
从当前的RSS feed中得到并且显示带有五个链接的列表:
 
To get and display a list of 5 links from an existing RSS feed:


%%%<?php  
%%%<?php  
第20行: 第18行:
%%%
%%%


==Parameters==
== 参数 ==
{{Parameter|$uri|URI|The URI of the RSS feed you want to retrieve. The resulting parsed feed is returned, with the more interesting and useful bits in the items array.}}
{{Parameter|$uri|URI|你想要得到的RSS feed的URI。返回最后解析后的feed,items数组中有更有趣,更有用的位。}}
{{Parameter|$num|integer|The number of items to display.}}
 
[[WordPress:Category:Functions]]
{{Parameter|$num|integer|将要显示的items的数目。}}
[[WordPress:Category:Functions|类别:函数]]
 
==输出==


==Output==
输出的内容看起来像:
The output will look like the following:


%%%<ul>
%%%<ul>
第36行: 第36行:
%%%
%%%


== Related ==
==相关的==
[[WordPress:Function_Reference/fetch_rss|fetch_rss]]
[[WordPress:Function_Reference/fetch_rss|fetch_rss]]

2008年7月26日 (六) 10:29的最新版本

描述[ ]

得到RSS feed,对其解析,将其显示为链接的无序列表。使用MagpieRSS and RSSCache函数,为真正的retrieval解析并且自动隐藏和Snoopy HTTP client

用法[ ]

%%%<?php include_once(ABSPATH . WPINC . '/rss.php'); wp_rss($uri, $num); ?> %%%

例子[ ]

从当前的RSS feed中得到并且显示带有五个链接的列表:

%%%<?php include_once(ABSPATH . WPINC . '/rss.php'); wp_rss('http://example.com/rss/feed/goes/here', 5); ?> %%%

参数[ ]

类别:函数

输出[ ]

输出的内容看起来像:

%%%

  • <a href='LINK FROM FEED' title='DESCRIPTION FROM FEED'>TITLE FROM FEED</a>
  • (repeat for number of links specified)

%%%

相关的[ ]

fetch_rss