Displaying My Blog Feed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
millsy007
Forum Commoner
Posts: 78
Joined: Wed Jul 02, 2008 7:00 pm

Displaying My Blog Feed

Post by millsy007 »

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?

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>';
?>
 
Post Reply