Displaying My Blog Feed
Posted: Thu Dec 11, 2008 9:22 am
I have a wordpress blog in a subdirectory of my site, I want to keep it seperate from the rest of my site, but would like to access the latest posts on my sites homepage.
I am trying to do this by reading the blog feed and displaying it but the code I have found relies on a wordpress function, but as I have this installed on a different section of my site I cant access that functionality. Is there a way I could modify the following to get out what I need?
I am trying to do this by reading the blog feed and displaying it but the code I have found relies on a wordpress function, but as I have this installed on a different section of my site I cant access that functionality. Is there a way I could modify the following to get out what I need?
Code: Select all
<?php
require_once(ABSPATH . WPINC . '/rss-functions.php');
$rss = fetch_rss('http://www.mysite.nl/blog/rss');
echo '<ul>';
for($i=0;$i<5;$i++) {
$item=$rss->items[$i];
echo '<li><a href="' . $item['link'] . '" title="' . $item['title'] . '">' . $item['title'] . '</a></li>';
}
echo '</ul>';
?>