Support » Plugin: WP RSS Aggregator » [Plugin: WP RSS Aggregator] Limit Results

  • Resolved gfa202

    (@gfa202)


    Great plugin! Works like a charm.

    Was curious if there was a clean way to limit the results? I’ve been adding rss feeds to a widget on sidebar using php and the results are long! Any way to limit it to, lets say, last 50 items or so? Or maybe do you plan on adding pagination?

    Thanks!

    http://wordpress.org/extend/plugins/wp-rss-aggregator/

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author Jean Galea

    (@jeangalea)

    This is something I can consider for the next update. Rather than pagination I think I would add a limit, say 10 items for each section (today, yesterday, 2 days ago etc.).

    Hopefully that would help you keep things tidier.

    adga

    (@adga)

    I have just installed the Aggregator and it does just what I want and is simple to use but I have the same issue as gfa202. So I am pleased to see you intend to address this. It would be better from my point of view if there was a way of setting the numbers of entries displayed in each section.

    Thanks.

    I am adding my “yes please” to this!

    Plugin Author Jean Galea

    (@jeangalea)

    Thanks all feedback appreciated, I will gather all requests and work on them for the next release.

    Is that possible to show the images (thumbnails) and a beginning of the original posts with the plugin? I’m trying to create a content aggregator, and i’d like to use this plugin.

    Plugin Author Jean Galea

    (@jeangalea)

    It would be possible with modifications, I can’t guarantee that I’ll be adding this feature though.

    @ninanoespelho – just posted info on how to add images 🙂
    best,
    -jennyb

    Hi there,

    I’ve read Jenny’s solution on adding thumbnail but would like to know in specific location of adding those codes to wp-rss-aggregator.php.

    I’m not so sure of where to insert the following codes to wp-rss-aggregator.php?
    1) preg_match_all(‘/<img([^>]*)>/i’, $item->get_content(), $matches);
    // Get all of the image tags

    2) $all_images = $matches[0];

    Could anyone please guide me on these? Many thanks.

    a field to limit the number of items fetched for a particular feed would be nice — and/or a date limit field (i.e. nothing older than a month)

    great little plugin!

    hi! I am really new here, stupid than a newbie. 😀 I need some help.

    1. How do I limit the feeds to just the most recent? Like maybe 5 or 6 items?
    2. How to put the thumbnails?

    I am actually working on it, with de.pinque WP theme. I am trying to put it in my sidebar. Thanks a million. 🙂

    Plugin Author Jean Galea

    (@jeangalea)

    Coming in the new version 🙂

    Wow! Thanks. 🙂 Looking forward to it. 🙂 I wish I could also show the thumbnails. 😉

    Desperately wanting to limit number of posts in feed! :))))))

    And updated my add thumbnail explanation here for those in need. Hope it helps.

    cheers,
    -jennyb

    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

    OC2PS

    (@sooskriszta)

    This is the only working aggregator plugin, so I do hope that jeangalea implements this in the next version, and that the next version comes out soon.

    This is what I think:
    1. The site owner should be able to configure number of items/section. e.g. 10 per section
    2. The site owner should be able to configure how many sections…I, for instance, need only Today.
    The above 2 are absolutely required functions yesterday.

    Once we have the above 2, I hope jeangalea also looks at
    3. The site owner should be able to configure the maximum number of items from each individual feed that are allowed. e.g. Max 3 from NYTimes, max 1 from NBC, max 3 from BBC, etc

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘[Plugin: WP RSS Aggregator] Limit Results’ is closed to new replies.