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:
- Sun, 05 Feb 2012 04:50:41 +0000: VIDEO: One-minute World News - BBC News - Home
Watch the latest news summary from BBC World News. International news updated 24 hours a day. - Sun, 05 Feb 2012 04:37:04 +0000: VIDEO: Fidel Castro launches memoirs - BBC News - Home
Former Cuban President Fidel Castro has made a rare public appearance to launch his memoirs. - Sun, 05 Feb 2012 04:18:45 +0000: Romney takes early lead in Nevada - BBC News - Home
Partial results from the Republican caucuses in Nevada give Mitt Romney a convincing lead in his latest bid to win the US presidential nomination. - Sun, 05 Feb 2012 03:50:24 +0000: Transport hit as snow sweeps in - BBC News - Home
Snowfalls of up to 15cm (6in) cause disruption to road, rail and air travel in parts of Britain, with the threat of more delays later. - Sun, 05 Feb 2012 02:04:57 +0000: West deplores veto on Syria at UN - BBC News - Home
Western nations deplore the vetoing by Russia and China of a UN resolution condemning the crackdown in Syria, as dozens are killed in Homs.
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']
- 4 February 2012 20:19:11: GB set up final against Argentina - BBC Sport - Sport
- 4 February 2012 18:28:51: Lee breaks foot in Twenty20 win - BBC Sport - Sport
- 4 February 2012 17:24:49: O'Sullivan faces Maguire in final - BBC Sport - Sport
- 4 February 2012 14:54:31: Man City 3-0 Fulham - BBC Sport - Sport
- 4 February 2012 14:46:31: VIDEO: Lancaster 'chuffed' for England players - BBC Sport - Sport
- 4 February 2012 14:46:18: VIDEO: Very proud day - Robshaw - BBC Sport - Sport
- 4 February 2012 14:05:35: Forest owner Doughty found dead - BBC Sport - Sport
- 4 February 2012 13:53:39: Scotland 6-13 England - BBC Sport - Sport
- 4 February 2012 13:39:56: GB into Fed Cup World II play-off - BBC Sport - Sport
- 4 February 2012 13:23:48: VIDEO: Lambert salutes Norwich progress - BBC Sport - Sport
- 4 February 2012 13:19:45: VIDEO: Cisse red card changed game - Hughes - BBC Sport - Sport
- 4 February 2012 13:19:22: VIDEO: McCarthy revels in 'huge' win - BBC Sport - Sport
- 4 February 2012 13:12:00: VIDEO: Weather 'borderline' in Sunderland win - BBC Sport - Sport
- 4 February 2012 12:59:03: VIDEO: We were not good enough - Hodgson - BBC Sport - Sport
- 4 February 2012 12:51:04: VIDEO: Saint-Andre satisfied with win - 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:
[...] plug-in for #Wordpress, works great for Museum exhibition & event feeds, from @titusbicknell http://bit.ly/bJCqLK #mw2010 #mtogo Category: TwitterTags: fresh > [...]
[...] Eklenti Ana Sayfası [...]
awesome & simple plugin, exactly what I was looking for,
Thank you!
Hi Titus,
Simply Brilliant!
How can I style the RSS feed to display on the left with the Feed icon. Can two parallel feeds be added?
Please advise.
Hello,
Please forgive my ignorance, but does this plugin update the page when there are new items within the feed? If so, how often does it check for new feed items?
Thanks,
- Jes
The plugin makes a real-time request to the RSS location so each time the page loads the request is made and the most recent RSS info is returned. However, if you use a caching plugin on you website the RSS info will only be as current as your cache expiry time but even that should only be a few minutes.
Amit: the current plugin inherits the <ul> and <li> css styles for your page/post template; if you wrapped the shortcode in a <div> you could override that. You can use as many instances of the shortcode in a page/post as you like, but to make them show side by side you’ll need to build a div style with a float: left and a width less than half your content div width.
Cosmin: you are very welcome
I’m getting the following error…
Fatal error: Call to undefined method WP_Error::get_item_quantity() in /home/XXXXXX/public_html/wp-content/plugins/rss-in-page/RSSinpage.php on line 20
Any ideas why this might be?
things to try:
- go to the RSS feed directly and see if it has any current items as the plugin may choke if the results returned – 0
- remove and reinstall the plugin – I had some issues with the svn release of version 1.0
- send me a link ot the page and the rss URL you are using and I’ll try to replciate
Yours
Titus
how do you make the link back pop up in new window please help
Works fine. If I want to change the date (I would like to have it in this format: j F Y.) is that possible. (If yes, I would appreciate the code snippet…)
I have just published version 1.1
Joe: target attribute added to allow you to open links in a new window/tab
Burn: date format attribute added so you can format feed dates as you wish
Working fine just one quick question is it possible to bold the link title and add another colour to make the clickable link stand out?
Just was I was looking for. Cheers.
Don’t do what I did though. I just wasted five minutes of my life by putting the code in the ‘Visual’ rather than ‘HTML’ edit page and scratching my head wondering why it wasn’t working.
This is what comes of doing these things before the morning coffee!
Is it possible for the next version to be able to hide the description of the rss… so that i only get the list
muchmor: version 1.2 allows you to set a custom css class to style the list;
Paul: version 1.2 allows you to suppress the description.
Please add a demo.
Tom: demo added on this page.
Amit: version 1.2 allows you to style the RSS feed with set a custom class: http://www.titusbicknell.com/wordpress/rss-in-page
Titus–
I’ve tried various methods to create a page with a list of articles in a category. Like your plugin, others suggest format for a “shortcode”, but I can’t seem to find where the “shortcode” needs to be inserted. How about some clarification.
Thanks–
Pete
I want to add this in front of my page at index.php file.
Can it be added into a php page?
Hi!
I am getting:
Fatal error: Call to undefined method WP_Error::get_item_quantity() in /public_html/wp-content/plugins/rss-in-page/RSSinpage.php on line 23
when trying:
[rssinpage rssfeed='http://pipes.yahoo.com/pipes/pipe.run?_id=b246f14eaff57a27b8332b48538b1e8b&_render=rss']
Rendering other RSS-feeds works fine.
The Yahoo Pipes-RSS renders fine in the browser. Is there an issue with rendering RSS from Yahoo Pipes?
/Andreas
Pete: put the shortcode into any post or page editing window in your WordPress site and the list will appear in the text in that location.
Joro: I’ll have to think about this and get back to you!
Andreas: you have found a bug thanks! The issue is the & sign in the feed URL from Yahoo: when processed the URL is encoded so the & becomes & and the feed fails. I am looking at how to fix this as it is part of the simple pie class and will answer as soon as I can.
Titus, excellent!
It’ll be great to get Pipes support! I use that all the time for RSS consolidation and filtering.
I’d love to send some money your way for your code. Didn’t find any donate button or anything like that in the first browse through of the site. How can I support you?
/Andreas
Andreas: you are very kind – I had a donate button hidden on another internal page so moved it to this page
I hope to resolve the issue with URL encoding soon to allow yahoo pipes feeds to work with the plug in.
Joro: you can activate the function in your index page code by adding the following:
<?php
$atts = array(‘rssfeed’ => ‘feedURL’);
echo rssinpage($atts);
?>
you can add any of the optional attributes to the array.
Andreas: version 1.5 addresses the issue preventing feed URLs with iso-8859-1 entities from parsing – your pipes feeds should now work fine.
Hi, This is an awesome plugin! Just wondering if it’s possible to have the date *after* the title?
hey titus. first of all, thanks for this plugin!
i have the 1.5 version installed but some feeds that render just perfectly fine in my browser or other rss readers still dont work with the plugin.
in fact, it is most feeds that i have tried. is that maybe due to the type of feed? like rss 2.0, rss 1.0, atom or something like that? i dont know..
the following feeds work:
http://feeds.feedburner.com/brasilienmagazin
http://feeds.feedburner.com/Lateinamerika?format=xml
but the following feeds dont work:
http://blogs.aljazeera.net/taxonomy/term/152/all/feed
http://www.amerika21.de/feed/RSS
http://www.npla.de/index.php?option=com_jevents&task=modlatest.rss&format=feed&type=rss&modid=54
do you know why?
thx in advance
Cindi: I shall work on a custom output code base in the 2.0 release but that will take some time. For now you can edit the plug-in file to alter the output order or I can make you a custom version of the plug-in for a small donation;
Jascha: the aljazeera, amerika and npla feeds work fine for me so not sure of the issue – can yous end me a link to the page where they do notwork?
thx for the quick reply! i use the working feed on brasilienblog.info in the box on the left.
you can see one that does not work here:
http://brasilienblog.info/feature/test-rss/
i used the following code to generate the feed in the article:
[rssinpage rssfeed='http://blogs.aljazeera.net/taxonomy/term/152/all/feed' rssitems='3' rsstarget='_blank' rssdateformat='j F Y' rsscss='rssclass' rssdescription='no']
by the way: i just looked at the RSSinpage.php..
is it true that if i insert exactly before get_permalink().’” target=”‘.$rsstarget.’”>’.$rss_items[$i]->get_title().’
that the rss title will then be one line below the date? that would be useful for me!
oh sorry my comment wasnt supposed to look like that.. wordpress messed something up there assuming i wanted to insert a link using html
im also sorry for all these questions.. i just have one more: is it also possible to limit the length of the title or description?
maybe by adding some character limit in the RSSinpage.php?
I nned to mix Rss in Page with Page Sliders plugin but it does not shows feeds just the code [rssinpage ...]
and also one last question from me:
is it possible to use $localeCode in the RSSinpage.php somewhere to change the language of the date?
thx in advance!
Jascha: I added your sample to this page to show it working – see above. Can you try it with no optional attributes to see if that works? Feel free to alter the code to get a better output
Federico: please disable the Page SLiders plug in and confirm if the RSS in Page shortcode works? It will help me understand where the problem lies.
thx titus but its still not working.. maybe it has something to do with my server or the way it does things..i dont know..
but its alright, i can still use it for some feeds. for the other feeds i might have to use another rss reader and insert it as plain html.. :/
but thanks again for your help.
but i´d love to know if it is possible to limit the length of the title or description and also if it is possible to change the language output of the date in your feed?
greetings from germany
Jascha: that it still does not work suggests a server config or core preference setting is different than mine – sorry that will nto be easy to debug.
I am looking into multilingual date formatting and will let you know as soon as I understand how it is done!
Do you want to limit the the title or description length by words or characters?
i assume something like that..but dont worry about that, i bet your script works fine in most websites.
).
i would rather limit them by characters and then put a “…” behind it.
this way it will always be the same length. some words are way bigger than others so limiting it by words might still mess up my design (i only have very little space in that box
how to use this plugin when i want post only description of any feed.?
and more…this plugin don’t show links as click-able…
Please include a link to the page on which you are having an issue – please try the plugin with no optional attributes first and another rss URL to help identify where the problem lies.
the 2.0 release allows you to style the output using format parameters: if you only want to show the title for example use rssformat=’y', the description rssformat=’z’ or some combination e.g. rssformat=’d: Y – z’
hey, its me again.. the 2.0 release features sound nice!
are now also going to add the possibility to limit the description or title by characters?
that would be awesome!
Jascha: the trim function will be in the next release.
The RSS Feed from Google News has a problem with the plugin. It doesnt redirect to the news url item.
Titus – just downloaded your plug-in and put the following line in using the HTML editor for the page:
[rssinpage rssfeed='feeds.feedburner.com/rotary/PBqj?format=xml']
The page shows nothing at all: http://rotary.kussner.com/ri/rotary-international-newsfeed
I did not embed the plugin into our theme. Is this required to make it work?
Thanks!
Rae: your feedURL needs http:// – [rssinpage rssfeed='http://feeds.feedburner.com/rotary/PBqj?format=xml']
Prakash: not sure what this issue is but shall look into it
Thanks Titus! I feel like an idiot, but thanks for using your fresh eyes to spot my error!
Rae
Rae: your question was perfectly valid and I shall add a URL verification function in the next release.
Prakash: the Google RSS feed is not formed in a way that simplepie can easily strip the Google tracking codes; unfortunately it would be almost impossible to distinguish a string that is part of the valid URL as distinct from a Google tracking code as the codes are added to the end of the code string. AS such I have to say that for now my plug in is not compatible with the Google News RSS feed.
Jascha: version 2.1 includes the ability to truncate the title.
Rae: version 2.1 allows you to drop the http:// from your feed URL.