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 01:13:11 +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. - Wed, 19 Jun 2013 00:50:29 +0000: US surveillance 'foiled 50 plots' - BBC News - Home
The head of the US electronic spying agency tells Congress surveillance programmes leaked to media helped thwart 50 attacks since 2001. - Wed, 19 Jun 2013 00:46:17 +0000: Attack follows news of Afghan talks - BBC News - Home
Four US soldiers have been killed at Bagram airbase in Afghanistan, hours after the US announced direct talks with the Taliban. - Wed, 19 Jun 2013 00:30:45 +0000: Jail reckless bankers, report urges - BBC News - Home
A report commissioned by the UK government calls for new measures, including criminal sanctions, to make bankers responsible for their own failings. - Wed, 19 Jun 2013 00:23:19 +0000: Nigeria militants kill school pupils - BBC News - Home
Suspected Boko Haram militants in Nigeria kill at least nine school children, in what survivors suggest is a response to growing vigilante groups.
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:
Michael: the plugin creates an unordered list so whatever styling your theme applies to the <li> tag will be applied to the rss output – your theme seems to have no bullets on any lists so you will have to define a custom css per the attribute listed above the adds the bullet.
Vinny: the mckinsey feed is timing out causing the feed parser to abort – take that feed out and see if the feed works without it.
Angie: not sure what you are trying to achieve but coding a URL variable into the feed processor would be more easily done by altering the plugin code than modifying the shortcode syntax – if you can give me more info I may be able to answer the question in a more constructive way.
Has anyone else had issues with the latest version (2.8) not playing well with WP 3.1? On… http://www.geekbusiness.com/advertising-networks/casale-media/, I am using the following shortcode (removed brackets for this comment only)… rssinpage rssfeed=’http://casalemedia.wordpress.com/feed/’ rssdateformat=’M j, Y’ rsstarget=’_blank’ rssformat=’x: y – z’
You can see that none of the formatting is working. I deleted the cache files to make sure that was not the issue. It’s obviously something I am doing… can someone point it out?
Thx
found the problem… and I was a moron. There were embedded
tags in it.... probably something to do with my pasting in the shortcode to "design" viewHi Titus,
in future versions, it would be nice to have the option to choose the attribute rel=”nofollow” in the generated href.
Cheers
cassius
Hi Titus,
Thanks for the plugin. I’ve looked at a lot of them for parsing rss and this one is very capable. Two questions: (1) I can’t get it to output more than 50 items, and (2) when I use multiple feeds, the output isn’t arranged by date but by feed (and I’d like for the output to be displayed by date regardless of the feed source).
Thank you!
Glenn
Hi Titus
A few questions and requests:
1) Feeds containing a comma, such as this one “http://ec.europa.eu/social/rss.jsp?langId=en&n=all,&” do not work…perhaps because comma is used to separate multiple feeds. Is there any solution?
2) Is it possible to add “filter” words.
3) What about pagination, for e.g., to have 30 items but display them over 3 pages
Thanks
Vinny
A little way down Titus answered Joro:
you can activate the function in your index page code by adding the following:
‘feedURL’);
echo rssinpage($atts);
?>
you can add any of the optional attributes to the array.
Can you give me an example of the array using some of the attributes: when I paste in the above code with correct feedurl in my index template I get a php parse error:
Parse error: syntax error, unexpected ‘:’, expecting ‘)’ in /home/domainname/public_html/dev/wp-content/themes/themename/template-home.php on line 84
line 84 is the one starting $atts = array …
‘http://feeds.news.com.au/public/rss/2.0/aus_business_mining_704.xml’);
echo rssinpage($atts);
?>
Can you give an example of a full array statement so I know the right format (i am not a real php coder obviously
Thanks.
Flip
Hello I am using the rss in page for wordpress but when I use itunes and add the rss and go to the frontend of the website and click any of the links this is what I get – Missing offer id cookie – I did a search and seen lot of others are having this same problem but I havent seen a fix for it yet.
possible to do collapse/expand of feed? selectable to number of items to show at first ad expand to max length
i use jquery collapse o matic–its quite extensive but the simple one (the first shortcode) works fine for all or nothing situations
Vinny: trim the feed like this http://ec.europa.eu/social/rss.jsp?langId=en&n=all and it works fine – have added your other items to the feature wish list.
Flip: simple example would be:
$atts = array(‘rssfeed’ => ‘http://feeds.news.com.au/public/rss/2.0/aus_business_mining_704.xml’,
‘rssitems’ => ’15′);
echo rssinpage($atts);
Hii..
Im am starting using your plugin, and i think i works very fine for me.
But i have a little problem: I can´t get the css part to work?
What shall i do?
i called the css: rsscss=’rsscss’
Shall i make a new rsscss.css in the theme? i need some hints.
can you please help me a bit.
Hi Titus,
I am attempting to use your plugin to import an RSS feed that has some HTML formatting built-in. The feed items render correctly in my feed reader, but when RSS in Page renders the items, it strips all formatting (and some data, wrapped in tags).
Here’s the feed: http://mtshastachamber.com/directory/rssfeed.php?thecondition=catid=400&number=100&field=title&ascdesc=ascending
This is what it looks like in WP: http://visitmtshasta.com/dining/
(I’m using RSS to get data from one script to appear in WP – if I can just get the formatting right, I won’t have to resort to iframes…)
The code I’m using in the template is:
'http://mtshastachamber.com/directory/rssfeed.php?thecondition=catid=400&number=100&field=title&ascdesc=ascending', 'rssitems' => '100', 'rssformat' => 'Yz');echo rssinpage($atts);
?>
Am I doing anything wrong? Is WordPress stripping the formatting, or the plugin? (Among other things, it’s leaving off websites because they’re wrapped in an a tag.) Any help you can give will be most appreciated!
. I am using
[rssinpage rssfeed='http://www.lexisnexis.ca/updates/whatsnewlawnet.xml' rsstarget=’_blank' rssformat='x: Y – w' ]and the date is not insert in the place of x.
i get:
: Ahousaht Indian Band v. Canada (Attorney General) (Aboriginal law, Natural resources law; B.C.C.A.; May 18, 2011) — Aboriginal bands could fish for and sell any species of fish in environs of their territories but this did not extend to geoduck clam fishery. – LAW/NET(TM) Legal Update Service
Am i doimg something wrong?
Rene: I am afraid I cannot offer CSS support but there are lots of online resources to help.
Danielle: Could you give me an example of info that is being stripped as the page on your site looks pretty comprehensive?
Guy: there is no date in the feed so nothing the plugin can do
Hello Titus,
How would I get a music chart to display in order, from #1, like here… http://www.billboard.com/rss/charts/hot-100
any help appreciated, love the plugin =)
Hi Titus,
Like Flip, I, too am getting the php syntax error: unexpected ‘:’, expecting ‘)’
I tried using your example you posted in response to Flip and add it to my index page, but the same error pops up.
Using WP 3.0 and Php 5
Hoping you can help.
Hi
a feed has not updated on the page of mine, but has from RSS point of view:
Feed:
http://www.physnews.com/feed.xml
Implementation:
General Physics (RSS)
[rssinpage rssfeed='http://www.physnews.com/feed.xml' rssitems='3' rsstarget='_blank' rssdateformat='d.m.Y' rssdescriptionlength='300']
Shows:
General Physics (RSS)
14.06.2011: J&J wins U.S. approval for hip replacement system - Physics News
NEW YORK (Reuters) - A ceramic-on-metal artificial hip system made by Johnson & Johnson for patients with osteoarthritis has won U.S. approval, the Food and Drug Administration said on Tuesday.
14.06.2011: Researchers record two-state dynamics in glassy silicon - Physics News
Using high-resolution imaging technology, University of Illinois researchers have answered a question that had confounded semiconductor researchers: Is amorphous silicon a glass? The answer? ...
What goes on ? The other feed seems to have updated…
Hello,
When I try to activate
I get:
Parse error: syntax error, unexpected ‘&’, expecting T_VARIABLE or ‘$’ in RSSinpage.php on line 33
???
Thanks in advance
…
Hey
previous post has now updated, at least was update today….not sure what was/is going on.
OTHER QUESTION:
If we are enabled to have multiple feeds, it would be very useful among the global amount specifier “rssitems” to also be able to specify at least how many of EACH RSS you want to be in the list.
If I have a science RSS put together spanning over News of
Universe
Sun
Planets
I may want to have the lasted 2 of EACH feed. Could that be introduced ?
Thanks for looking into this
Thank you for such a useful plugin! It really has brought together alot of our websites into one hub
I would like to ask though, is there a way of not displaying the date + time of RSS posts? had a look in the php and got a little scared off!
Its just this bit of each post I want to remove: Wed, 08 Jun 2011 17:08:00 +0000:
Many thanks again my friend, p.s. – where is the donate button?
My latest tweets stopped showing up 7.21.11, not sure why? Any thoughts? Thanks for any help.
These are HPOAco’s latest tweets:
[rssinpage rssfeed='https://twitter.com/statuses/user_timeline/181133206.rss' rssitems='3' rsstarget='_blank' rssdateformat='j F Y H:i:s' rsstimezone='America/New_York' rssformat='x: Y' ]
Thank you for this plugin and the details about customizing the output.
im working on a rss feed for both wordpress and mobile
the yahoo rss feeds work in simplepie but doesnt work with rssinpage..can you look into this
i owe you a donation–itll be forthcoming when my site goes live
phil
chilly + Jenna: simply create a rssformat without x and no date will appear – donate button is on this page
philip: please provide the yahoo feed you are trying to make work
Hi Titus,
Really loving the plugin. Have it working great with a Facebook status RSS feed. However, the website owner has just posted a link to a Youtube video and understandably it doesn’t display this. Any ideas how I could go about fixing this?
Thanks,
Phil
… In case you want a link the page (on test server) http://www.fauvic.com/latest-news/ or soon to go live on http://www.jerseypartybooth.com/latest-news. Thanks again!
Can an example CSS file be shown here?
Where does the file need to go, and what’s required to be in in?
I understand you don’t want to get into the ‘how to style it like this…’ but some sort of starting point would be useful.
Thanks, Mark
Hi there,
is there a way to add pagination to the output? thanks
The possibilities of this plugin are many, thank you very much
I’m trying to use this wonderful plugin but I can not make it work.
On page http://pickandwin.es/picks-liga-de-blogs/ put the code [rssinpage RSSFeed = 'http://pickandwin.es/forum/?xfeed=all' rsstimezone = 'Europe / Madrid'] and I get no content.
Can you help?
Fairly noob…need to insert a feed into the sidebar on a page. I know the code below isn’t correct, I just need to know what to put around the rssinpage block.
New Items
[rssinpage rssfeed='http://www.mysite.com/rss.asp?type=newreleases']
You wrote: “simply create a rssformat without x and no date will appear”
How do you create an “rssformat without x”. I don’t see an x anywhere in the code. How do I remove the date again? Thank you, am trying out this and other RSS plugins and this one is by far the best so far.
Is there a way to show the description of a feed but eliminate any images and/or links that are included in the description? It is really messing with my custom template formatting when the feed includes images or links in the descriptions…if not, it might be something that you could add to the update wish list.
Great plugin by the way, it has made my life so much easier. Thank you!
Phil: please send me the shortcode you are using and I’ll see if I can help with the youtube parsing.
Mark: in the example above I created this css code:
ul.rssclass {list-style: none;}
ul.rssclass li { color: #666666; }
ul.rssclass a { color: #ff0000; text-decoration: none; font-weight: bold; text-transform: uppercase;}
ul.rssclass a:hover { color: #66cc33; text-decoration: none; }
and then coded the shortcode with the variable rsscss=’rssclass’ and the CSS is applied. It can go in any file as long as that file is referenced before the shortcode requests it.
Tywin: no support for pagination at this time sorry.
Seldoms: the feed is configured in a funny way – no obvious solution at this time sorry.
Troy: since the standard WordPress RSS widget does a great job for sidebars so I dd not code my plug in for sidebars.
Cody: add rssformat=’y – z’ to your shortcode and as long as x does not appear in it no date will show.
battangel: please send me an example feed so I can think through an answer.