WordPress Plugin: RSS in Page

This plugin allows you to include an RSS feed in your page or post using a shortcode.

[rssinpage rssfeed='feedURL']

will return the 5 most recent items in the feed with a date, title, link and description.

The plugin is at version 2.8 and supports multiple feed URLs separated by commas and the addition of the feed name:

[rssinpage rssfeed='feedURL1, feedURL2']

The plugin supports truncation of the feed title and description.

There are several optional attributes:

  • rssformat allows you to format the output using format parameters e.g. the default x: Y – w<br>z where x is the date, Y is the title with a link, y is the title, z is the description and w is the feed name
  • rssitems returns a different number of items
  • rssorder returns the oldest rss items rather than the most recent
  • rsstarget=’_blank’ opens links in a new window/tab, default is ‘_self’
  • rssdateformat allows item date to be formatted using php date parameters, default is RFC 2822 formatted date
  • rsscss allows you to set a css class to style the list rather than the default content list style in the theme
  • rsstitlelength allows you to truncate the title to a certain character length, default returns the whole title
  • rssdescriptionlength allows you to truncate the description to a certain character length, default returns the whole description
  • rssdescription=’no’ allows you to suppress the description, default is to show it – this still works, but is deprecated: you should use rssformat instead
  • rsstimezone allows you to set the timezone in which the feed datetime will be displayed, default is UTC; use values from the php list of supported timezones e.g. PST is America/Los_Angeles, MST is America/Denver, CST is America/Chicago, EST is America/New_York

Please review the php list of supported timezones here to find a city in your timezone.

[rssinpage rssfeed='feedURL' rssitems='15' rssorder='asc' rsstarget='_blank' rssdateformat='j F Y' rsscss='myclassname' rssformat='x: y - z']

You can embed the plugin into your theme using the following code snippet:

<?php
$atts = array(‘rssfeed’ => ‘feedURL’);
echo rssinpage($atts);
?>

You can add any of the optional attributes to the array.

Download the plugin at http://wordpress.org/extend/plugins/rss-in-page

For example:

[rssinpage rssfeed='newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml'] shows:

  • Wed, 19 Jun 2013 03:22:04 +0000: US House passes abortion-limits bill - BBC News - Home
    The Republican-controlled US House of Representatives passes a bill that would limit terminations to the first 20 weeks after conception.
  • Wed, 19 Jun 2013 03:11:48 +0000: Alaa Jarban: One of Yemen's first openly gay men - BBC News - Home
    Fears for author of 'I'm Queer' blogpost
  • Wed, 19 Jun 2013 02:42:33 +0000: Brazil clashes after Rousseff praise - BBC News - Home
    Riot police and demonstrators clash in new protests in Brazil's largest city, Sao Paulo, after President Rousseff praises the protests' aims.
  • Wed, 19 Jun 2013 02:42:30 +0000: Older beetles 'make better dads' - BBC News - Home
    Older male burying beetles work harder at parental care and mating than younger counterparts, a study suggests.
  • Wed, 19 Jun 2013 02:38:02 +0000: 'Hoff' crab's oceanic 'road trip' - BBC News - Home
    A hairy crab named after US actor David Hasselhoff hitched a ride on an ocean "highway" to colonise deep sea vents in the Atlantic tens of millions of years ago.

while:

[rssinpage rssfeed='newsrss.bbc.co.uk/rss/sportonline_world_edition/front_page/rss.xml ,
newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml' rssitems='15' rssdescription='no' rssdateformat='j F Y H:i:s' rsstimezone='America/New_York' rsscss='rssclass' rsstarget='_blank']
shows:

Please note: RSS in Page is built on the excellent SimplePie framework. Before submitting a support comment please check your feed is valid at http://simplepie.org/demo – if it functions there and you are still experiencing an issue please ensure to add the feed in your support request.

If you find this plug in useful please consider donating to its future development:

243 Comments

  1. titusbicknell says:

    Jerry: what rss URL are you trying to display – please provide me the complete shortcode.

  2. Ford says:

    Great plugin. I would like to ask that how i can control amount description’s word. I don’t want show to many word at description…

    Many Thanks!!

  3. Knolly says:

    This plugin saved my bacon!! brilliant piece of work.

    I did find a minor issue though. I found the description from the last item is carried forward and applied to feed items that have nothing in the description. This only happened in our application because we’re using RSS to publish calendar items which sometimes only contain a title and no description.

    The solution was simple enough:

    //Knolly – there’s an issue in that $z retains the last description if none is present in the feed item. I’ll clear it here:
    line 70 $z = ”;
    //End Knolly add

    Many thanks

  4. titusbicknell says:

    Ford: truncation of the description will be in the next release.
    Knolly: many thanks for your kind words and for catching this bug – it will be addressed in the next release.

  5. nomad says:

    Great plugin. Is it possible to limit the length of the rss description? It’s possible with simplepie, so I suppose it will be possible with your plugin as well?

  6. Tacheles says:

    Hi
    I find the plugin great. But i have a problem with a feed to display.
    The plugin doesn’t display feeds in this constellation “http://news.piratenpartei.de/syndication.php?fid=207&limit=15″

    The constellation from the feed “http://news.piratenpartei.de/syndication.php?limit=15 ” display it right.
    Can you help?

  7. titusbicknell says:

    Nomad: please see comment reply above about description truncation.

    Tacheles: I looked at the URL and it has no feeds but it looks like a typo in the URL so I changed it to http://news.piratenpartei.de/syndication.php?id=207&limit=15 and it works.

  8. dfwtinker says:

    I can’t seem to get any of the google (news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss), time (feeds2.feedburner.com/time/topstories.rss.xml) or the only feeds that seem to work are those that actually end with rss.xml like in the example …[rssinpage rssfeed='newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml']

    Any help you can provide in resolving this would be greatly apprecited.

    Also is there any provision for getting the thumbnail that goes with the article?

  9. dfwtinker says:

    I would like to add this spinning globe icon to the beginning of each post on page 2 (ktwhitaker.com\supply) instead of the little white dots. My original goal was to include the pictures that came with the individual rss feed. However I can live with this option if you can tell me how to make it work. THe location of the url i won’t to use is … ‘spinningglobe’ => ‘href=”http://ktwhitaker.com/support/wp-content/uploads/2011/01/rotating-earth.gif”‘,

  10. Wim Dezutter says:

    Is it possible to delete RSS feed lines where the date is wrong and the standard date is filled in (1 Jan 1970) ? Thanks for the good work !

  11. steve says:

    great plugin thanks.

    is there a way to make the feed display in a table instead of a list?

  12. rosa says:

    this is truly useful. Before I set about looking at the code is there a simple code to show no date or time of the post- ? my posts are for upcoming events you see and i dont want people to get confused with the date the post was written. will donate as soon as i get paid. thanks Rosa

  13. titusbicknell says:

    rosa: simply define rssformat without the x value and no date will display
    stevedfwtinker: you can define a css class using rsscss and style the feed in whatever way you choose
    wim: no way currently to edit the rss feed data that is returned but I shall look into it

  14. Jack says:

    I just updated to the latest version of this plugin, and it caused the links to be formatted weird. Is there a new way to use the shortcode now?

  15. Jack says:

    Nevermind. It was because I had customized the php page.

  16. Rick Smith says:

    Have installed – one of the better plugins out there.

    Question: If I placed the shortcode on a post where only the last RSS item is shown, would I need to create another post to grab the next item published in the RSS feed?

    Or will the post ‘refresh’ and become new when the RSS feed is updated? I want to use the shortcode on a post so I can choose a category for the post to belong in (‘News’). A page with the shortcode would have to be linked and wouldn’t show up in the category ‘News.’

    Thanks for any help you can provide.

  17. Jack says:

    Can you give an example of code to put in the theme? The short example given doesnt work for me.

    I dont know what this represents:

    echo rssinpage($atts);

    Thanks!

  18. titusbicknell says:

    Jack: e.g.
    $atts = array(
    ‘rssfeed’ => ‘newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml’,
    ‘rssitems’ => ’15′);
    echo rssinpage($atts);

    if you need to know what a given php tag means please go to http://www.php.net/manual/en/index.php

  19. titusbicknell says:

    Rick: the plug in is designed to refresh the feed so each time the page loads the rss data is current

  20. titusbicknell says:

    Rosa: simply create an rssformat attribute with x in it e.g. rssformat=’Y – w’

  21. Chris says:

    Is there a way to add a class to the date? I would like to be able to style this differently than the rest of the text. If not, if you could point me to the place in the code that maybe I could add it that would be awesome :)

  22. Lloyd says:

    Hi, this is a great plugin. Works perfect. I just wanted to make “Continue reading” open in a new page. Is this possible? Thanks.

  23. Martin says:

    Do I have to put the PHP-code somewhere in my theme to get the sortcode to work? In that case, where?

  24. titusbicknell says:

    Chris: line 58
    Lloyd: I am not sure where you are seeing continue reading but it is not part of the plug in – can you provide me a link as an example?
    Martin: nope just insert the shortcode into a page or post – if nothing shows you may have an error with the feed which you can verify at http://simplepie.org/demo

  25. Martin says:

    Thanks, but feed works at your link but not shortcode on my wordpress page…

  26. titusbicknell says:

    Martin: send me a shortcode example and I’ll take a look.

  27. Martin says:

    Thanks!

    [rssinpage rssfeed='feed://ttela.se/1.617479']

  28. titusbicknell says:

    Martin: reformat as [rssinpage rssfeed='http://ttela.se/1.617479'] and it works fine.

  29. Martin says:

    Thanks!!

  30. Paul says:

    Also Titus, in creating a page specifically to track another site’s comments, I found that it’s limited to 10 items, despite my increasing the number to 20. I noticed in the google reader that it lists about 80 comments with the same link. Odd.

    [rssinpage rssfeed='http://lakingsinsider.com/comments/feed/' rssitems='20' rssdescription='yes' rsstimezone='America/Los_Angeles' rssdateformat='D, M j g:ia' rsscss='rssclass' rsstarget='_blank' rssformat='Yz']

    Any idea how to get the shortcode to display more than 10 comments like google?

    Thank you. If it’s complicated but doable, please email me so we can talk compensation.

  31. Paul Evans says:

    HI Titus – great plug in – I’ve been waiting for one as good as this.

    I’m not the world’s greatest techie and I can’t work out what the code would look like if I wanted to ONLY show the date and the post title from my feed (and not the source of the feed – I’m using my google reader shared item feed and it gets a bit repetitive!

    Thanks

  32. Paulie says:

    Hi Titus – great plugin – I’ve been looking for something as good as this for a while – thanks for sharing it.

    I’ve tried using it to get my Google Reader Shared Items feed and it works fine, but I’m no great coder and I’d like to get a list that just has the title, date (but not time) and a short extract (say 200 characters with a ‘read the rest’ link at the end of it). I definitely DON’T want the source though….

  33. titusbicknell says:

    Paul: the http://lakingsinsider.com/comments/feed/ feed is configured to only deliver 10 items so there is no way for my plugin to retrieve more data than that; if you have access to the developers of that site you might be able to get them to alter the way the feed is constructed to deliver more data;

    Paul: to show date and title only add rssformat=’x: Y’to your shortcode;

    Paulie: to show date title and extract add rssformat=’x: Y – z’ rssdescriptionlength=’200′to your shortcode – plug in does not offer a read the rest link in this version but the link built into the title will take you to the full item

  34. Paul says:

    Did you see this question? I sent it before my last one, but no answer…

    Very cool plugin. The shortcode is so close to doing what I want, but I can’t quite get there. Maybe you’ll be able to help. I simply want to list x number of feeds (say 3 to make it simple) and have exactly that number of feeds shown (1 entry for each site) AND have them sorted by most recent post.

    In this example, there are 3 feeds listed but 3rd site (frozenroyalty) won’t list because the last post is a few days old. The end result was 1 item from Jewels and 2 items from Insider.

    [rssinpage rssfeed='http://lakingsinsider.com/feed, http://www.jewelsfromthecrown.com/rss, http://frozenroyalty.net/feed' rssitems='3' rssdescription='no' rsstimezone='America/Los_Angeles' rssdateformat='D, M j g:ia' rsscss='rssclass' rsstarget='_blank']

    Am I making sense? I’d imagine it’s easy to do, but I can’t figure it out.

  35. Fuji says:

    Hey man…

    Thanks for the great plugin, works like a charm. I have one question though.

    My readers can optionally submit RSS thru gravity forms, however when they dont submit a feed, i get :

    Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home1/domain/public_html/website/wp-includes/class-simplepie.php on line 7854

    Which is not so strange as the FeedURL is empty. would it be possible to to have a default value (perhaps an RSS feed without content) so i don’t get this message?

    Thanks in advance

  36. Ivar says:

    Hello there,

    I am trying to ad adsense to the imported rss posts. No matter what plugin I use, it doesn’t seem to work.

    Can you please tell me if this is possible. And if it is, then I would like to know how offcourse! :)

    Kind regards

    Ivar

  37. titusbicknell says:

    Paul: create three separate shortcodes limited to one item each

  38. phil bravin says:

    am building a website–all of the feeds work except this one–can you take a look at this…thanks

    http://www.sportsmx.com

    Phil

  39. titusbicknell says:

    Phil: http://www.sportsmx.com is not a feed URL – please verify the correct address for the feed and test it at http://simplepie.org/demo/ – if it works there it will work in the plug in.

  40. Chuck says:

    I am trying to use this with Apple’s iTunes rss feeds and keep getting a “missing offer id cookie” error when I click on the links that are rendered on my page. It appears to be truncating or something.

    Here is the code I am using for RSS in Page:

    [rssinpage rssfeed='http://itunes.apple.com/us/rss/topalbums/limit=50/genre=22/xml?partnerId=30&LS_PARAM=http%3A%2F%2Fclick.linksynergy.com%2Ffs-bin%2Fstat%3Fid%3DrD8dmL9Sdws%26offerid%3D146261%26type%3D3%26subid%3D0%26tmpid%3D1826%26RD_PARM1%3D' rssitems='50' rssorder='asc' rsstarget='_blank' rssdateformat='j F Y' rssformat='x: y - z']

    Here is the page itself: http://blog.christianmusicreport.com/playlists/

    Any ideas?

  41. titusbicknell says:

    Chuck: the plug in is working but the link format is not supportable I am afraid.

  42. Kevin Baker says:

    Very useful plugin. I have loaded in a feed from a wp-ecommerce website to display products. Is it simple to add a custom field like price? For example: [rssinpage rssfeed='http://www.hookpublications.com/index.php?rss=true&action=product_list&category_id=1' rssitems='15'] has XML called . Is it simple to add this tag?

  43. Kevin Baker says:

    The tag name in the previous post was “product:price”.

  44. Michael Winn says:

    Titus,
    Excellent plugin my friend. I know you mentioned adding rss.css to “stevedfwtinker” but is there an easier way to just add the bullet points to separate each post? Am I missing something?

    I am using: [rssinpage rssfeed='http://respartners.com/feed/' rssdateformat= "M o" rssdescriptionlength= "90"]

  45. Vinny says:

    I am trying to use the following shortcode but it does not work the way I’ve seen it work initially. Based on this shortcode, I only get the first feed even if I know there are feeds for the others too. If I extend the number to 50 feeds, then I get the second one but the third one does not appear. I would like the feeds from all sources to arrange chronologically, which it used to do before but somehow misbehaves now. Any thoughts?

    [rssinpage rssfeed='http://www.bcg.com/62.rss, http://rss.mckinseyquarterly.com/f/100003s2jja1l06emqg.rss, http://feeds.feedburner.com/DeloitteUSEmergingTechnologies' rssitems='15' rssdateformat='j F Y' rsstimezone='America/New_York' rsscss='rssclass' rsstarget='_blank' rssdescription='no']

  46. Michael Winn says:

    Hi Titus,

    Can’t seem to figure out why posts don’t format with the bullet beside each listing.

    Any idea?

    http://respartners.com

    Thanks

  47. Angie says:

    Thank you for an excellent plugin.

    I am a PHP newbie so apologies for this question and for using
    the wrong PHP syntax.
    Is there any way to use a dynamic URL or to set part of the
    rssfeed URL via a function? Using something like:
    [rssinpage rssfeed=getURL()] or
    [rssinpage rssfeed='http://www.siteussedinfeed.com/cat=' . getCategory()]

    If not is there a workaround?

    Thanks
    Angie

  48. David says:

    Hi! Thanks for the great plugin!

    But there is a problem with german umlauts, but only if the last character of the description is one. Here is a screenshot:

    http://www.reise-videoblog.com/scr.jpg

    Can I truncate the description to a certain word count to resolve the problem?

  49. titusbicknell says:

    David: the plugin supports truncation of title and description per the attributes listed above but has no word count truncation.

  50. titusbicknell says:

    Kevin: parsing the feed for an additional tag would require custom development – since it would be feed specific I would need to charge for the work – you are very welcome of course to modify the code yourself.

Leave a Reply