Post RSS Feeds in WordPress

Feedburner Google RSS Feed

I was looking at the other day. It’s a website that displays all the top headlines from many popular websites. You can see an example below, where I pulled the top 5 headlines from the New York Times.

[rss feed=”” num=”5″]

This list will change dynamically, as the headlines at the New York Times change. If you click on the link you’ll be taken to the original article. How did I do this?

  • Copy and paste some code into your functions.php file
  • Get the address for your chosen RSS feed
  • Copy and paste a line of code, called a short code in WordPress, into your WordPress posts

How to Create the RSS Feed Retrieval Function

  • Click on Appearance, in the left side bar in WordPress
  • Click on Editor, under Appearance in the left side bar
  • Find the file named functions.php, on the right side of the page that opens
  • Click on functions.php, and paste the following code in it

//This code is needed to use the wp_rss() function.
function readRss($atts) {
“feed” => ‘http://’,
“num” => ‘1’,
), $atts));
wp_rss($feed, $num);
return $output_string;
add_shortcode(‘rss’, ‘readRss’);

  • Click the Update File button

Get Some RSS Feed Addresses

You now have to find an RSS Feed URL that you’d like to display. You can find tons of feeds here Bloglines. Here are some of the most popular feeds:



How to Display Your Feed Links

To paste links to Yahoo’s top 5 entertainment feed link’s, I would just cut an paste this line of text:

rss feed=”” num=”5″]

You could link to any other RSS feed by changing the value of feed. You could also change the number of links shown by changing the value of num. It is set to show 5 links in the example above.

WordPress Short Codes

You just created a WordPress Short Code! You use short codes to easily execute PHP code scripts inside of  your posts. There are tons of short codes available that:

  • Insert Google Adsense ads automatically, by just entering adsense, inside of brackets []
  • Perform styling
  • Create links to other random sites or functionality

If you’d like me to talk more about short codes, leave a comment below.

That’s All Folks

Sorry for the short post today, but I’m working on a bunch of major projects for you of course! You should be very happy with the results. If you have any questions leave them in the comment section below.

Here to Serve

Think Tank

Leave a Reply

Your email address will not be published.