-1

I need to pull in 2 different RSS feeds from an external site into our site. I have two questions about how to best do this:

  1. I want to cache the feed so that it doesn't get pulled in every time someone visits the site. What is the best way to go about doing that in WordPress?
  2. I will need to output the data (post title and thumbnail image) for each post. What is the best way to go about doing that in WordPress?

Thanks for your help!

0

I think you're looking for the core function fetch_feed(), your new best friend!

From the Codex:

Retrieves an external feed and parses it. Uses the SimplePie and FeedCache functionality for retrieval and parsing and automatic caching.

and

fetch_feed caches results for 12 hours by default. You can modify this by modifying the time interval via the filter wp_feed_cache_transient_lifetime.

  • 1
    Small hint. The core cached the feed inside the transient, so inside the database. If you like a cache, like object cache or what ever, then you must input more todos. – bueltge Sep 23 '14 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.