I have a Wordpress blog which works nicely and i'm trying to get the latest 3 gallery posts from my Wordpress home page to an external none Wordpress site. The feed I have found from the WP docs is
http://blog.bellavistagardens.co.uk/?feed=rss2
and I found some PHP code that should read this page.
$rss = new DOMDocument();
$rss->load('http://blog.bellavistagardens.co.uk/?feed=rss2/');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node)
{
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($feed, $item);
}
print_r($feed);
however when I print the feed its blank. If I print the $rss var then I can see its not getting me the items. I've hunted all over the web for an answer to this question now. Can someone please help or point as to where I'm going wrong.
thanks Stackers