Hi, the following works fine but I’d like to limit the max number of items pulled at a given time? Wondering how to do this?
PHP:
function rssNews() {
$items = xmlFeed('research');
$items = orderByDate($items);
$output = '';
$output = '<ul id="rssnews">';
if (count($items) >= 2) {
for ($i = 0; $i < count($items); $i++) {
if ($items[$i][description] != '') {
$cleanDate = convertPubDate($items[$i][pubDate], 'F dS, Y');
$output .= '<li>';
if ($items[$i][thumb] != '') {
$output .= '<img src="'.$items[$i][thumb].'" width="85px" height="85px" alt="'.$items[$i][title].'">';
} else {
$output .= '<img src="http://mydomain.com/images/placeholder.png" width="85px" height="85px" alt="'.$items[$i][title].'">';
}
$output .= '<h3><a href="'.$items[$i][link].'" target="_blank">'.$items[$i][title].'</a></h3>';
$output .= '<p>'.htmlspecialchars_decode($items[$i][description]).' <em class="date">'.$cleanDate.'</em></p>';
$output .= '</li>';
}
}
} else {
$output .= '<li><article><p>Please check back soon</a>.</p></article></li>';
}
$output .= '</ul>';
return $output;
}