shireknight
Member
Posted 2 years ago #
I installed my blog in http://mydomain.com/blog/. I'm using Magpie RSS to parse the feed from WordPress on the main site's homepage (http://mydomain.com/index.php) and I get empty space. No errors, nothing. The feed works fine in the blog pages. I tried moving the same code I used to parse the feed to another site and it works, I tried bookmarking the feed and that works too. I just can't for the life of me tell why its not working on the homepage. Help!
I've used Magpie to successfully pull WP RSS feeds onto a site on the same domain and pull feeds from other WP sites. What are you using to call the feed in Magpie?
shireknight
Member
Posted 2 years ago #
This is the code I'm using to parse the WP feed:
require_once 'rss/rss_fetch.inc';
$url = 'http://benvalentine.info/blog/?feed=rss2';
$rss = fetch_rss($url);
if($rss) {
foreach ($rss->items as $item) {
$link = $item['link'];
$title = $item['title'];
echo '<p>>> <a href="' . $link . '">'.$title.'</a></p>';
}
}
print_r($rss) was only able to pull up the most recent feed and nothing else. The code above produces no errors or feed items.