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 , shows:
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']
- 18 June 2013 19:01:33: Camelot seeks Royal Ascot revenge - BBC Sport - Sport
- 18 June 2013 18:48:19: Froome 'relief' at Wiggins Tour loss - BBC Sport - Sport
- 18 June 2013 18:13:11: Hearts rejected late investment bid - BBC Sport - Sport
- 18 June 2013 18:03:30: Campbell-Brown given provisional ban - BBC Sport - Sport
- 18 June 2013 17:31:58: Irish take centre stage at emotional Ascot - BBC Sport - Sport
- 18 June 2013 17:29:25: Carroll passes West Ham medical - BBC Sport - Sport
- 18 June 2013 17:06:06: Scolari calls for calm from protestors - BBC Sport - Sport
- 18 June 2013 16:22:14: Venus Williams to miss Wimbledon - BBC Sport - Sport
- 18 June 2013 15:33:33: Bogdanovic & Baker lose in qualifiers - BBC Sport - Sport
- 18 June 2013 15:25:38: MotoGP grid set to increase in 2014 - BBC Sport - Sport
- 18 June 2013 14:53:29: Grabarz injury forces withdrawal - BBC Sport - Sport
- 18 June 2013 14:19:19: Italy U21 2-4 Spain U21 - BBC Sport - Sport
- 18 June 2013 14:12:09: Lee match-fixing hearing date set - BBC Sport - Sport
- 18 June 2013 14:07:37: VIDEO: Bale should move for career - Zico - BBC Sport - Sport
- 18 June 2013 13:26:20: Pearce to leave as England U21 coach - BBC Sport - Sport
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:
Jerry: what rss URL are you trying to display – please provide me the complete shortcode.
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!!
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
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.
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?
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?
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.
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?
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”‘,
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 !
great plugin thanks.
is there a way to make the feed display in a table instead of a list?
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
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
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?
Nevermind. It was because I had customized the php page.
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.
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!
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
Rick: the plug in is designed to refresh the feed so each time the page loads the rss data is current
Rosa: simply create an rssformat attribute with x in it e.g. rssformat=’Y – w’
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
Hi, this is a great plugin. Works perfect. I just wanted to make “Continue reading” open in a new page. Is this possible? Thanks.
Do I have to put the PHP-code somewhere in my theme to get the sortcode to work? In that case, where?
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
Thanks, but feed works at your link but not shortcode on my wordpress page…
Martin: send me a shortcode example and I’ll take a look.
Thanks!
[rssinpage rssfeed='feed://ttela.se/1.617479']
Martin: reformat as [rssinpage rssfeed='http://ttela.se/1.617479'] and it works fine.
Thanks!!
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.
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
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….
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
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.
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
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
Paul: create three separate shortcodes limited to one item each
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
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.
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?
Chuck: the plug in is working but the link format is not supportable I am afraid.
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?
The tag name in the previous post was “product:price”.
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"]
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']
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
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
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?
David: the plugin supports truncation of title and description per the attributes listed above but has no word count truncation.
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.