Fetch feeds? Simplepie integration?
-
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
https://codex.www.ads-software.com/Function_Reference/fetch_rss
https://codex.www.ads-software.com/Function_Reference/fetch_feed
does anyone knows how do i use the new function?
thanks
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Fetch feeds? Simplepie integration?’ is closed to new replies.