So i just made my first RSS feed, or so i tought, in combination with CI. Now my view DOES display the top of my rss page (Title and Description), But all items are omitted. When i rightclick->view source it DOES contain all the items within the item tags.
Can anyone help me?
View (rss.php):
<?php echo '<?xml version="1.0" encoding="'.$encoding.'"?>'."\n"; ?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title><?php echo $feed_name; ?></title>
<link><?php echo $feed_url; ?></link>
<description><?php echo $page_description; ?></description>
<dc:language><?php echo $page_language; ?></dc:language>
<dc:creator><?php echo $creator_email; ?></dc:creator>
<dc:rights>Copyright <?php echo gmdate("%Y", time()); ?></dc:rights>
<dc:date><?php echo gmdate("%Y-%m-
T;%H:%i:%s%Q", time()); ?></dc:date>
<admin:generatorAgent rdf:resource="http://www.codeigniter.com/" />
<?php foreach($items as $entry): ?>
<?php $entry_url = base_url().$this->lang->lang().$localized_news[$this->lang->lang()].'/'.print_date(strtotime($entry->published), "{year}/{month2}").'/'.$entry->slug; ?>
<item>
<title><?php echo xml_convert($entry->title); ?></title>
<link><?php echo $entry_url; ?></link>
<guid><?php echo $entry_url; ?></guid>
<description><?php echo $entry->summary; ?></description>
<pubDate><?php echo date('r', $entry->published); ?></pubDate>
</item>
<?php endforeach; ?>
</channel>
This is what the output looks like: screenshot
and in the source, every item needed to be displayed is there. with
<item> <link> <description> <guid> and <pubdate>
tags.
Ive been looking for the cause for about 1.5 hours now. and i cant find anything. Can someone tell me if i did anything wrong? Appreciate the help!
~Menno