How to get more than 25 items via Simplepie RSS Feeds?

I have a feed with 50 items but seemingly no matter what I do, it always returns just 25. $feed->set_item_limit(50); or $rss_items = $rss->get_items(0,50); none of these have any effect nor do I see any reference to the number 25 in the class source, I don’t get it. The feed is http://gdata.youtube.com/feeds/base/users/silviavaldemoros/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile&max-results=50 1 Answer 1 … Read more

fetch_feed: retrieve entries in the appearing order, not chronologically

I’m using WP function fetch_feed to retrieve a feed and display its items. <?php /* include the required file */ include_once(ABSPATH . WPINC . ‘/feed.php’); /* specify the source feed */ $rss = fetch_feed(‘FEED_URL’); /* checks obj. is created */ if (!is_wp_error( $rss ) ) : /* specify number of items */ $maxitems = $rss->get_item_quantity(4); … Read more

Getting Post Thumbnail from RSS feed with SimplePie

I am trying to pull the post thumbnail from an RSS feed to output on an external site. I am using the following function to add the post thumbnail to the site: function rss_post_thumbnail($content) { global $post; if(has_post_thumbnail($post->ID)) { $content=”<p>” . get_the_post_thumbnail($post->ID, ‘be_home’) . ‘</p>’ . get_the_content(); } return $content; } add_filter(‘the_excerpt_rss’, ‘rss_post_thumbnail’); add_filter(‘the_content_feed’, ‘rss_post_thumbnail’); … Read more

WordPress SimplePie modifications

I am using the fetch_feed() function provided in WordPress to build a SimplePie feed object. The code from WP is the following: function fetch_feed($url) { require_once (ABSPATH . WPINC . ‘/class-feed.php’); $feed = new SimplePie(); $feed->set_sanitize_class( ‘WP_SimplePie_Sanitize_KSES’ ); // We must manually overwrite $feed->sanitize because SimplePie’s // constructor sets it before we have a chance … Read more

How to use cache with simplepie

According to the docs, if you want to cache results for a fetch of RSS feeds with simplepie, you do this: add_filter( ‘wp_feed_cache_transient_lifetime’ , ‘return_7200’ ); $feed = fetch_feed( $feed_url ); remove_filter( ‘wp_feed_cache_transient_lifetime’ , ‘return_7200’ ); My question is if I want to cache the results for several feed urls (by looping through an array), … Read more