WordPress.org

Ready to get started?Download WordPress

Forums

FeedWordPress
Number of Posts (12 posts)

  1. bookinfo
    Member
    Posted 4 months ago #

    Hello,

    I think FeedWordPress is a great Plug-in, but I do have one issue. I have the plug-in set to convert the feed items to posts, but I only want to most recent item from each RSS that I input. Is it possible to have FeedWordPress only import the most recent item?

    Thanks

    https://wordpress.org/plugins/feedwordpress/

  2. Sascha Foerster
    Member
    Posted 4 months ago #

    That's probably what you have been searching for.

  3. bookinfo
    Member
    Posted 4 months ago #

    Okay, I've never used GitHub before so I have no idea which part of the code I actually need. Can you clarify a little bit? Thanks so much.

  4. Beer
    Member
    Posted 3 months ago #

    Can you try adding this to your functions.php file?

    function fwp_first_item( $data, $fwp )
    {
        static $first = true;
        if ( ! $first ) return null;
        $first = false;
        return $data;
    }
    add_filter( 'syndicated_post', 'fwp_first_item', 10, 2 );

    This won't limit posts by date, but it may skip all feed results except the first one.

  5. dotboxdesign
    Member
    Posted 2 months ago #

    I need to import more than the normal 10 recent posts. I want to import more like 85 posts from a feed.

    Can you help?

  6. Beer
    Member
    Posted 2 months ago #

    Mine pulls in more than 10 at a time. Actually, I believe it pulls in everything in the feed. Look at the feed you want to use and see how many items it contains.

  7. dotboxdesign
    Member
    Posted 2 months ago #

    I am pulling from:

    http://www.laceandlikes.com/blog/

    There are 86 posts associated with that site.

    Thoughts?

  8. Beer
    Member
    Posted 2 months ago #

    That feed only displays 10 items at a time. I'm not sure how to get older results. It's up to the webmaster of the site.

  9. george09
    Member
    Posted 1 month ago #

    hello.I would like to ask if it's possible with a function to syndicate 1 post (most recent) from each feed at once .I have set 10 feeds and i want, when i update them (manual or with cron job) to pull 1 post for each one (1x10=10 posts).I have tested the above function and it works but it gives me as result only 1 post from all my feeds. I have tried also to use the" limit posts by date" plugin without success. I need some help for this, thanks.

  10. Beer
    Member
    Posted 1 month ago #

    @george09, I haven't setup a test site with the strategy you're using. Give this a try and see if it does what you need. When I get time I'll check back and see if we need to make any changes. Add this to your functions.php file.

    function fwp_skip_first_item_per_feed( $data, $fwp )
        {
            static $feeds = array();
    
            $id = SyndicatedLink::id();
            if ( isset( $feeds[ $id ] ) ) return null;
            $feeds[ $id ] = true;
            return $data;
        }
        add_filter( 'syndicated_post', 'fwp_skip_first_item_per_feed', 10, 2 );
  11. george09
    Member
    Posted 1 month ago #

    hi and thanks for the quick reply .I tried to add this code in my functions.php and it gives me a fatal error. So i would like to ask something else that maybe is a little more easy. I tried for the same purpose to use the Limit posts by date plugin. It works for limiting the posts number but there is an issue.When a feed contains more posts than the number that i have set up to pull, the plugin limits the number of the posts but not the syndicated items(?) from the rest posts (out of my target).So in this case when i use a plugin for caching locally the images (cache images) the images from the rest posts (skipped posts) are also imported on my media library. Is any filter for the syndicated items for skip them all except those ones that icluded in the posts that i pull.Thanks again.

  12. Beer
    Member
    Posted 1 month ago #

    the last line in the code sample above doesn't display the ending ); is it possible you missed that?

Reply

You must log in to post.

About this Plugin

About this Topic