Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When I use fetch_feed() to pull in posts from a feed, even if I set the maximum posts variable to a very high number, it will only pull in 10 posts. I want to pull in all the posts and then paginate the way I would for my regular blog posts. I thought maybe it was set to the number in my Reading settings, but I changed it to 30 with no change. There are definitely more than 10 posts in the feed I am trying to pull in. Is this possible or is this inherently limited for this function?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

It sounds like your source feed is showing only 10 posts. So, regardless of what you pit for get_item_quantity, only 10 posts will show, max.

If you're pulling posts from a WordPress site, you can adjust how many posts are included in the RSS feed in Settings -> Reading.

Change this value: "Syndication feeds show the most recent"

share|improve this answer
    
That is exactly the problem, thank you. –  clampdesign Apr 12 '13 at 9:06

from wordpress codex: http://codex.wordpress.org/Function_Reference/fetch_feed

    // Figure out how many total items there are, but limit it to 5. 
$maxitems = $rss->get_item_quantity(5); 

// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items(0, $maxitems); 

change the $maxitems to whatever you want. hope this is what you were looking for.

share|improve this answer
    
Thank you, but I should have been more clear. What I meant by "even if I set the maximum posts variable to a very high number, it will only pull in 10 posts" was that I changed maxitems = $rss->get_item_quantity(5); to maxitems = $rss->get_item_quantity(99); This didn't change the number of posts. –  clampdesign Mar 13 '13 at 22:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.