Modding FirstRSS plugin for wordpress to display maximum # of items

srhcom

Junior Member
Joined
May 12, 2009
Messages
101
Reaction score
54
I am trying to edit FirstRSS to limit output of RSS items to 10. Here is the code that outputs all items in the feed. I am not a programmer so any help is appreciated! I pulled this off of the firstrss comment page.
Code:
[B]

                    // Item title, description, & link
                    foreach($rss->items as $item) {
                        $title = $item[title];
                        $link = htmlentities($item[link]);

                        if ($title != '') $disp .= "\t<a href='$link'>$title</a><br />\n";
                    }
                }

        [/B]
Here is the snippet I want to put in to limit output to 10 items. It isn't working though, all items are still displayed.

Code:
// Item title, description, & link
$i=0;
foreach($rss->items as $item) {
if($i < 10) {
$title = $item[title];
$link = htmlentities($item[link]);
if ($title != '') $disp .= "\t$title\n";
}
$i++;
}
 
Last edited:
Back
Top