> ## Content Index
> Fetch the complete content index at: https://mfitzp.ghost.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Display external RSS feeds on your WordPress blog
- URL: https://mfitzp.ghost.io/display-external-rss-feeds-on-your-wordpress-blog/
- Published: 2012-01-26T00:00:00.000Z
- Updated: 2024-03-28T21:27:29.000Z
- Author: Martin Fitzpatrick
- Tags: Tutorials, Wordpress, #Import 2024-03-14 08:20, #Import 2026-08-24 14:26

Show another of your blogs or any other RSS news feed on your WordPress blog with this simple template code.

Open your template file in either the WordPress admin editor or via FTP/SSH access to your hosting server. If you want to put the feed links in your sidebar either look for a `sidebar.php` or similar file.

Locate where you want to include the feed and add the following code:

```PHP
<?php include_once(ABSPATH.WPINC.'/feed.php');
$rss = fetch_feed('https://www.martinfitzpatrick.com/rss/');
$maxitems = $rss->get_item_quantity(5);
$rss_items = $rss->get_items(0, $maxitems);
?>
<ul>

<?php if ($maxitems == 0) echo '<li>No items.</li>';

else

// Loop through each feed item and display each item as a hyperlink.

foreach ( $rss_items as $item ) : ?>

<li>

<a href='<?php echo $item->get_permalink(); ?>'

title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>

<?php echo $item->get_title(); ?></a>

</li>

<?php endforeach; ?>

</ul>

```

You will *probably* want to modify the code to change the `fetch_feed` URL to your own blog (or leave it as is to show mine!). Change the `get_item_quantity(5)` to the number of items you wish to show.

Save the file and refresh your blogpage. You should now see the feed entries in your page!