WordPress.org

Ready to get started?Download WordPress

Forums

get_item_quantity returns 0 (1 post)

  1. freshifreshy
    Member
    Posted 4 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