0

I'm trying to include an RSS feed in my blog using fetchfeed() and loop through the items, in sidebar.php. Instead of the feed, I get this text "The file simplepie.php could not be found." I searched for a while and could only find references to class-simplepie.php, not simplepie.php. Does anyone have any idea what is going on, here?

Here's my code:

<?php if(function_exists('fetch_feed')): ?>
    <?php include_once(ABSPATH.WPINC.'/feed.php');
    $feed = fetch_feed('feed URL');
    $limit = $feed->get_item_quantity(5);
    $items = $feed->get_items(0, $limit);
    if(!$items) {
        echo "There was an error.";
    } else { ?>
        <?php foreach($items as $item): ?>
            <div class="sidebar_post">
                <p class="date"><?php echo $item->get_date('F j, Y'); ?></p>
                <h5><?php echo $item->get_title(); ?></h5>
                <p><?php echo $item->get_content(); ?></p>
            </div>
        <?php endforeach; ?>
<? } ?>
<?php endif; ?>
sinrise
  • 391
  • 3
  • 21

1 Answers1

0

Add this line to your wp-config.php

define('WP_MEMORY_LIMIT', '64M');

Bharat Gaikwad
  • 530
  • 2
  • 5
  • 16