Plugin Directory

Simple Feed List

Author: David Artiss

This is a very useful sidebar addition, as it can be used to display all sorts of useful information in a list format - news updates, site updates, software updates, etc. All you need is the URL of the RSS feed.

To display an RSS feed on your WordPress site you will need to insert the following code, where appropriate, into your theme…

<?php simple_feed_list('listurl','limit','descflag'); ?>

Where..

listurl : This is the URL of your RSS feed

limit : The number of items to display from 1 to 20 (default is 5)

descflag : This indicates whether you wish to display the description on the line below. This should be "Yes" or "No" or a numeric length. If left blank, it will assume to be "No". If a number is specified this will be used as the maximum length of the description.

This will then display a list of entries from the RSS as an HTML list (i.e. with <li> and </li> around each entry).

An example would be...

<?php simple_feed_list('http://images.apple.com/trailers/home/rss/newtrailers.rss','5',''); ?>

This would display a list of the latest 5 movie trailers from the Apple site. Descriptions will not be shown.

<?php simple_feed_list('http://images.apple.com/trailers/home/rss/newtrailers.rss','5','200'); ?>

This would display a list of the latest 5 movie trailers from the Apple site. Descriptions will be shown, up to a maximum length of 200 characters.

The following is an example of how it could be used, with a function_exists check so that it doesn't cause problems if the plugin is not active...

<?php if (function_exists('simple_feed_list')) : ?>
<h2>Latest Apple Movie Trailers</h2>
<ul><?php simple_feed_list('http://images.apple.com/trailers/home/rss/newtrailers.rss','5',''); ?></ul>
<?php endif; ?>

If you specify a limit of just 1, then the <li> tags will not be used, allowing you to embed the result in a sentence. For example, you could use a feed of quotes and use this to just display the latest quote.

Download

FYI

Compatibility beta

Your Setup

Log in to vote.

The Consensus

No data

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(2 ratings)