Created
March 7, 2012 13:05
-
-
Save matfish2/1992996 to your computer and use it in GitHub Desktop.
WP: Embedding RSS links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php | |
include_once(ABSPATH.WPINC.'/rss.php'); // path to include script | |
$feed = fetch_rss('http://feeds.feedburner.com/blogowicz'); // specify feed url | |
$items = array_slice($feed->items, 0, 10); | |
?> | |
<?php if (!empty($items)) : ?> | |
<?php foreach ($items as $item) : ?> | |
<li><a href="<?php echo $item['link']; ?>" rel="nofollow"><?php echo $item['title']; ?></a></li> | |
<?php endforeach; ?> | |
<?php endif; ?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment