Forums

RSS feed doesn't appear on index page (3 posts)

  1. 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!

  2. esmi
    Theme Diva & Mod
    Posted 2 years ago #

    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?

  3. 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>>>&nbsp;<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.

Topic Closed

This topic has been closed to new replies.

About this Topic