• Well, I used the recommended code etc in order to pull my twitter feed; this is the code:

    <?php // Get RSS Feed(s)
    include_once(ABSPATH.WPINC.'/feed.php');
    
    // Get a SimplePie feed object from the specified feed source.
    $rss = fetch_feed('https://twitter.com/statuses/user_timeline/2893631.rss');
    
    // Figure out how many total items there are, but limit it to 3.
    $maxitems = $rss->get_item_quantity(3); 
    
    // Build an array of all the items, starting with element 0 (first element).
    $rss_items = $rss->get_items(0, $maxitems);
    ?>
    
    <ul>
        <?php if ($maxitems == 0) echo '<li>No items.</li>';
        else
        // Loop through each feed item and display each item as a hyperlink.
        foreach ( $rss_items as $item ) : ?>
        <li>
            <a href='<?php echo $item->get_permalink(); ?>'
            title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
            <?php echo $item->get_title(); ?></a>
        </li>
        <?php endforeach; ?>
    </ul>

    It stops and just says “No items.” And trust me, that feed definitely has new items every day!

    The web page is https://riverscapewebstudios.com and I”m running 2.9.1 – so my question is, is there something I’m doing wrong?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter brandnewaquarium

    (@brandnewaquarium)

    The only thing I can think of is that it’s pulling a Twitter feed; however, I tried it with other feeds, and it still didn’t work ??

    Thread Starter brandnewaquarium

    (@brandnewaquarium)

    Other nuances: I am running the same theme locally, and live. Locally the RSS actually *does* work, but live it does *not*.

    WPChina

    (@wordpresschina)

    See my post here too, as I am also having issues with this. My problems are the same actually — I can not get any info from other WordPress blogs using RSS2.0, so I want to make the “No items” work. The “No items” does not work for me, but it seems to work for you?

    WPChina

    (@wordpresschina)

    I still have this similar problem… does anyone else have this problem or a solution?

    lunamedia

    (@lunamedia)

    Hi, had exact same problem; feed working locally on MAMP, not live. Seems to have been fixed by switching

    https://www.example.com/rss2.php

    instead of

    https://www.example.com/feed

    Shouldn’t work but it does for me… would like to know the real story behind what’s up here though…

    paperboy

    (@paperboy)

    I’m using the same code too but don’t get my public Twitter feed to show up.. I don’t even get the “No items”. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘fetch_feed not working’ is closed to new replies.