Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5538a47
commit 541fc4a
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
?> |