站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Function Reference/get rss
”
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
==Description== == 描述== Retrieves an RSS feed and parses it, then displays it as a list of links. The get_rss() function only outputs the list items, not the surrounding list tags itself. 得到RSS feed并且对其解析,然后将它作为链接列表显示。get_rss()函数只会输出列表items而不是周围的列表标签本身。 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. 使用[http://magpierss.sourceforge.net/ MagpieRSS 和 RSSCache]函数为真正的retrieval解析,自动储存并且[http://sourceforge.net/projects/snoopy/ Snoopy HTTP client]。 ==Note== ==注== A bug in 2.06 prevents this function from working correctly. This bug will likely be fixed in 2.07 or 2.08. 2.0.6中的程序错误阻碍了这个函数正常地运行。这个程序错误可能在2.0.7或者2.0.8中得到解决。 ==Usage== == 用法 == %%%<?php require_once(ABSPATH . WPINC . '/rss-functions.php'); get_rss($uri, $num = 5); ?> %%% %%%<?php require_once(ABSPATH . WPINC . '/rss-functions.php'); get_rss($uri, $num = 5); ?> %%% ==Example== == 例子 == The get_rss() function only outputs the list items, not the surrounding list tags itself. So, to get and display an ordered list of 5 links from an existing RSS feed: get_rss()函数只输出列表item,而不输出周围的列表标签本身。因此,得到并且显示现存RSS feed的五个链接的无序列表: %%%<?php require_once(ABSPATH . WPINC . '/rss-functions.php'); echo '<ol>'; get_rss('http://example.com/rss/feed/goes/here'); echo '</ol>'; ?> %%% %%%<?php require_once(ABSPATH . WPINC . '/rss-functions.php'); echo '<ol>'; get_rss('http://example.com/rss/feed/goes/here'); echo '</ol>'; ?> %%% ==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.|optional|5}} {{Parameter|$num|integer|The number of items to display.|optional|5}} [[WordPress:Category:Functions]] [[WordPress:Category:Functions|类别:函数]] ==Output== ==输出== The output from the above example will look like the following: 上述例子的输出内容,看起来像: %%%<ol> <li> <a href='LINK FROM FEED' title='DESCRIPTION FROM FEED'>TITLE FROM FEED</a><br /> </li> (repeat for number of links specified) </ol> %%% %%%<ol> <li> <a href='LINK FROM FEED' title='DESCRIPTION FROM FEED'>TITLE FROM FEED</a><br /> </li> (repeat for number of links specified) </ol> %%% == Further reading == == 深入阅读== * [[WordPress:Function_Reference]] * [[WordPress:Function_Reference|Function_Reference]]
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
模板:Parameter
(
编辑
)