Skip to content

Commit

Permalink
Adding RSS code
Browse files Browse the repository at this point in the history
  • Loading branch information
amberweinberg committed Jan 12, 2012
1 parent 5538a47 commit 541fc4a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rss.php
@@ -0,0 +1,13 @@
<?php // Get RSS Feed(s)
include_once(ABSPATH . WPINC . '/feed.php');

// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed('/feeds');
if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly
// Figure out how many total items there are, but limit it to 5.
$maxitems = $rss->get_item_quantity(20);

// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items(0, $maxitems);
endif;
?>

0 comments on commit 541fc4a

Please sign in to comment.