WordPress fetch_feed()->get_items()->get_another()

I want to import news to my WordPress site from an RSS structure like this:

<item>
    <title>...title...</title>
    <link>..link...</link>
    <description>...short description...</description>
    <full-text>...full-text...</full-text>
    <enclosure url="http://.../post_image123.jpg" type="image/jpeg"/>
    <category>...category...</category>
    <pubDate>Wed, 20 Nov 2013 17:32:41 +0400</pubDate>
</item>

I know how to get all of the tags except full-text, and I’ve not found any documentation about this. How do I get full-text?

Read More

Code:

<?php 
$rsslist = array(
    'http://kavkazinfo.net/backend.php?region=%C4%E0%E3%E5%F1%F2%E0%ED',
    'http://kavkazinfo.net/backend.php?region=%C8%E7%F0%E0%E8%EB%FC',
);

// Fetch all of the feeds into a simplePie mashup
$rss = fetch_feed($rsslist);
// Set the max items to either 5 or all items if there are less than 10
$maxitems = $rss->get_item_quantity(5);

// Get the items (0-5)
$rss_items = $rss->get_items(0, $maxitems); 

// If there are no items, output that
if ($maxitems == 0) {
    echo '<li>No items.</li>';
// Otherwise loop over the items
} else {
    foreach ($rss_items as $item) { ?>
        <li>
        <?php echo $item->get_fulltext(); ?> // Of course, get_fulltext() doesn't exist as a function, so how do I get it?
        </li>
    <?php 
    }
}
?>

Related posts

Leave a Reply

2 comments