Quantcast
Viewing latest article 2
Browse Latest Browse All 2

How to filter/block RSS feed items with SimplePie

I've got a google news feed I display in my WordPress site, using the following code:

$feed = fetch_feed($rss_url); // specify the source feed$limit = $feed->get_item_quantity(20); // specify number of items$items = $feed->get_items(0, $limit); // create an array of itemsforeach ($items as $item) :     echo $item->get_description(); endforeach;

Problem is, certain individual articles I need to filter out. Google news items have guid tags. Given the guid of the item, how can I tell SimplePie to ignore the given item?

Thanks-


Viewing latest article 2
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>