Parse RSS feed / display content from Wordpress blog?

I want to tease the latest entries of a Wordpress site on a Kirby site.

It makes a lot of sense to grab the RSS feed and display x items with custom markup.

But how?

Simply read the remote RSS-feed with file_get_contents() / CURL / simple_php_dom and wrap every entry / title / WordPress excerpt in a foreach ($rss->item as $item) function.

Or use one of the predefined solutions;

  1. Universal RSS Parser
  2. Last RSS
  3. Simple PIE

You can do whatever you want, it works without or with Kirby - it’s basic PHP.

I always create my own RSS wrappers with this class;

https://github.com/dg/rss-php

Plain and simple (with Kirby as the engine for my smartphone apps).


Maybe the last one is the best; no “stupid” framework, fast as hell, good documentation and totally CMS agnostic.

1 Like

Thanks 1n3JgKl9pQ6cUMrW!

:smiley:

1 Like

Worth mentioning here that WP 4.4 will include the REST API in core
http://v2.wp-api.org/

I’d probably just grab the RSS for this use-case, as well

You can also make use of this little helper from the Kirby Toolkit: http://getkirby.com/docs/toolkit/api/xml/parse