Hello,
I am trying to use Magpie RSS to display news feeds on my homepage.
The URL to my website is: http://www.owls-4u.com/
My homepage is named index.html.
I have my products listed down the right side of my homepage and I want to have the news feeds shown/listed on the left side of my homepage.
Could you please review my code and tell me what is wrong with the code and what I need to do to make the news feeds show up on my homepage???
Here is the link that I am trying to use as the source of the news feeds:
http://www.medicalnewstoday.com/rss/fitness-obesity.xml
Here is the code that I am currently using to try and display the news feeds:
<div id="Layer2" style="position:absolute; left:2px; top:326px; width:485px; height:1232px; z-index:2; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000;">
<table width="487" height="50" border="0">
<tr>
<td><div align="center"><span class="style12"><u>News, Reviews, and Other Information <br>
that is Related to Your Health </u></span></div></td>
</tr>
</table>
<!-- Beginning rss newsfeed -->
<?
require_once('magpierss/rss_fetch.inc');
$url = 'http://www.medicalnewstoday.com/rss/fitness-obesity.xml?a=out&f=1&show=10&type=rss';
$rss = fetch_rss( $url );
?>
<p>Site: <? echo $rss->channel['title']; ?></p>
<ul>
<?
// Start the foreach loop
foreach ($rss->items as $item ) {
// Define the Variables
$title = $item[title];
$date = $item[pubDate];
$url = $item[link];
$desc = $item[description];
?>
<li><a href="<? echo $url; ?>"><? echo $title; <? echo $date; ?></a>
<ul>
<li><? echo $desc; ?></li>
</ul>
</li>
<?
// Close the foreach function
}
?>
</ul>
</div>
Here is the current results on the code above when the website homepage above is opened/refreshed:
Site: channel['title']; ?>
items as $item ) { // Define the Variables $title = $item[title]; $date = $item[pubDate]; $url = $item[link]; $desc = $item[description]; ?>
Thanks,
Bobby Howerton