The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

get_item_quantity returns 0 (1 post)

  1. freshifreshy
    Posted 6 years ago #

    I'm using the fetch_feed function to pull info from an RSS. However, the get_item_quantity always returns 0, despite there being at least 1 item in the feed. I've checked and the feed is valid, so I'm a little confused as to where the problem is occurring. Here is a look at my code:

    include_once(ABSPATH . WPINC . '/feed.php');
    $rss = fetch_feed('http://talkradiox.com/station/archives/564/feed');
    $maxitems = $rss->get_item_quantity(1);
    $rss_items = $rss->get_items(0, $maxitems);
    if ($maxitems != 0) {
    foreach ($rss_items as $item) : 
    do something
    endforeach; } else { do something else }

Topic Closed

This topic has been closed to new replies.

About this Topic