Codex tools: Log in / create account
Contents |
Retrieves an RSS feed and parses it, then displays it as an unordered list of links. Uses the MagpieRSS and RSSCache functions for parsing and automatic caching and the Snoopy HTTP client for the actual retrieval.
<?php
include_once(ABSPATH . WPINC . '/rss.php');
wp_rss($uri, $num);
?>
To get and display a list of 5 links from an existing RSS feed:
<?php
include_once(ABSPATH . WPINC . '/rss.php');
wp_rss('http://example.com/rss/feed/goes/here', 5);
?>
The output will look like the following:
<ul>
<li>
<a href='LINK FROM FEED' title='DESCRIPTION FROM FEED'>TITLE FROM FEED</a>
</li>
(repeat for number of links specified)
</ul>