2

I have a feed with 50 items but seemingly no matter what I do, it always returns just 25.

$feed->set_item_limit(50); or $rss_items = $rss->get_items(0,50); none of these have any effect nor do I see any reference to the number 25 in the class source, I don't get it.

The feed is http://gdata.youtube.com/feeds/base/users/silviavaldemoros/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile&max-results=50

3
    include_once(ABSPATH.WPINC.'/feed.php');
    $rss = fetch_feed('http://gdata.youtube.com/feeds/base/users/silviavaldemoros/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile&max-results=50');
    $maxitems = $rss->get_item_quantity(50);

    $rss_items = $rss->get_items(0, $maxitems);
    print_r($rss_items);

Try this code..

  • My feed URL was htmlentities encoded which made it disregard the & bits of the URL -.- And YouTube v2 api sends 25 items by default. Your answer made me realize that I did it correctly but the URL was bad. – Firsh - LetsWP.io Dec 12 '14 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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