i use to have this beautiful piece of code to fetch a rss and show it on my site
<?php // Get RSS Feed(s) include_once(ABSPATH . WPINC . '/rss.php'); $rss = fetch_rss('url to feed'); $maxitems = 10; $items = array_slice($rss->items, 0, $maxitems); ?> <ul class="list2"> <?php if (empty($items)) echo '<li>No items</li>'; else foreach ( $items as $item ) : ?> <li><a href='<?php echo $item['link']; ?>' title='<?php echo $item['title']; ?>'> <?php echo $item['title']; ?> </a></li> <?php endforeach; ?>
now it is not working, and on the codex it is mentioned that the function fetch_rss has been deprecated and replaced by fetch_feed
does anyone knows how do i use the new function?