Installing SimplePie RSS


The SimplePie RSS application allows news feeds to be displayed on a web page.


  1. The display page must be a PHP file.
  2. A writable cache folder needs to created.


The following code needs to be placed at the very beginning of the PHP-based display page.

$feed = new SimplePie('http://news-source.tld/feed.file');

A writable folder named cache must be created in the same directory as the folder that contains the file.

drwxrwxrwx  user group cache
drwxr-xr-x  user group simplepie

The application must be called from within the display page.  Below is a snippet from the SimplePie website.

    <div class="header">
        <h1><a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a></h1>
        <p><?php echo $feed->get_description(); ?></p>

    Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.
    foreach ($feed->get_items() as $item):

        <div class="item">
            <h2><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></h2>
            <p><?php echo $item->get_description(); ?></p>
            <p><small>Posted on <?php echo $item->get_date('j F Y | g:i a'); ?></small></p>

    <?php endforeach; ?>



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: