Title: Fetch Feed
Author: JR Tashjian
Published: <strong>2009 年 1 月 22 日</strong>
Last modified: 2009 年 8 月 11 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/fetch-feed.svg)

# Fetch Feed

 作者：[JR Tashjian](https://profiles.wordpress.org/jrtashjian/)

[下载](https://downloads.wordpress.org/plugin/fetch-feed.1.5.zip)

 * [详情](https://cn.wordpress.org/plugins/fetch-feed/#description)
 * [评价](https://cn.wordpress.org/plugins/fetch-feed/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/fetch-feed/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/fetch-feed/#developers)

 [支持](https://wordpress.org/support/plugin/fetch-feed/)

## 描述

This plugin was created to retrieve and cache an RSS feed for use in a template.

What you do is pass the url to the feed you would like returned and the number of
minutes you would like the feed cached for. The
 plugin will cache the RSS xml and
return the feed as an object which you can loop through and output however you please.

New As Of Version 1.5:
 – Fixed a typo that caused the feed to be retrieved and 
cached every time. Credit: Binny V A (http://www.bin-co.com/blog/) – Thanks man!

### General Usage

fetch_feed_cache() is the only function you will be using with this plugin. fetch_feed_cache()
accepts 2 parameters.

 1. (string) $url – This is the URL to the feed you would like to parse
 2. (int) $cache_min – This is the amount of time in minutes you would like the feed
    cached for.

Here is an example of the plugin being used in a template:

    ```
    <?php $xml = fetch_feed_cache("http://jrtashjian.com/feed/", 60); ?>
    <h3><?=$xml->channel->title?></h3>
    <ul>
        <?php if( ! empty($xml)) : ?>
            <?php foreach($xml->channel->item as $item) : ?>
                <li><a href="<?=$item->link?>"><?=$item->title?></a></li>
            <?php endforeach; ?>
        <?php else : ?>
            <p>Delicious doesn't seem to be working at the moment...</p>
        <?php endif; ?>
    </ul>
    ```

Remeber, every feed could be different. If you need to see the structure of the 
object returned just use print_r().
 Example: `<?php print_r(fetch_feed_cache("http://
jrtashjian.com/feed/", 25)); ?>`

## 安装

 1. Upload the `fetch-feed/` directory to the `/wp-content/plugins/` directory
 2. Make sure the `fetch-feed/cache/` directory is writeable
 3. Activate the plugin through the ‘Plugins’ menu in WordPress

## 评价

此插件暂无评价。

## 贡献者及开发者

「Fetch Feed」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ JR Tashjian ](https://profiles.wordpress.org/jrtashjian/)

[帮助将「Fetch Feed」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/fetch-feed)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/fetch-feed/)，查看[SVN仓库](https://plugins.svn.wordpress.org/fetch-feed/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/fetch-feed/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/fetch-feed/)。

## 额外信息

 *  版本 **1.5**
 *  最后更新：**17 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 2.5 或更高版本 **
 *  已测试的最高版本为 **2.8**
 *  语言
 * [English (US)](https://wordpress.org/plugins/fetch-feed/)
 * 标签
 * [cache](https://cn.wordpress.org/plugins/tags/cache/)[feeds](https://cn.wordpress.org/plugins/tags/feeds/)
   [rss](https://cn.wordpress.org/plugins/tags/rss/)
 *  [高级视图](https://cn.wordpress.org/plugins/fetch-feed/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/fetch-feed/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/fetch-feed/reviews/)

## 贡献者

 *   [ JR Tashjian ](https://profiles.wordpress.org/jrtashjian/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/fetch-feed/)