Ok folks, I couldn’t wait and am very happy to announce that I have a solution for us ??
Modifiy the shortcode declartion in wp-rss-aggregator.php at line 223, by replacing
// Register a new shortcode
add_shortcode( 'wp_rss_aggregator', 'wprss_shortcode');
function wprss_shortcode( $atts ) {
if ( !empty ($atts) ) {
foreach ( $atts as $key => &$val ) {
$val = html_entity_decode($val);
}
}
wp_rss_aggregator( $atts );
}
with
// Register a new shortcode
add_shortcode( 'wp_rss_aggregator', 'wprss_shortcode');
function wprss_shortcode( $atts ) {
extract( shortcode_atts( array(
'limit' => '20',
), $atts ) );
if ( !empty ($atts) ) {
foreach ( $atts as $key => &$val ) {
$val = html_entity_decode($val);
}
}
wp_rss_aggregator( $atts );
}
This will add the “limit” variable with a default of 20.
Then, before the (or each of the) foreach statements replace:
`foreach ( $items_today as $item ) {
echo $link_before . ‘<a class=”colorbox” href=”‘ . $item->get_permalink() .'”>’. $item->get_title(). ‘ ‘. ‘</a>’;
echo ‘<br><span class=”feed-source”>Source: ‘.$item->get_feed()->get_title()/* . ‘ | ‘ . $item->get_date(‘l jS F’).”*/ . ‘</span>’;
echo $link_after;
}`
with
$feedlimit = $limit; //call variable
foreach ( $items_today as $item ) {
$counter++; //add counter
echo $link_before . '<a class="colorbox" href="' . $item->get_permalink() .'">'. $item->get_title(). ' '. '</a>';
echo '<br><span class="feed-source">Source: '.$item->get_feed()->get_title()/* . ' | ' . $item->get_date('l jS F').''*/ . '</span>';
echo $link_after;
if($counter >= $feedlimit) break; //break if count is met
}
Then, in your shortcode simply add limit=X, where X is the number of posts you want to show. Et voilà ! works on my end, let me know how it works for you!
-jennyb