fetch_feed not working
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('http://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 http://riverscapewebstudios.com and I”m running 2.9.1 – so my question is, is there something I’m doing wrong?
- The topic ‘fetch_feed not working’ is closed to new replies.