RSSPhoto
Description
RSSPhoto is a Wordpress plugin to display photos from RSS and Atom feeds. It includes a widget for easy addition to a sidebar, or it can be configured by shortcode to display on any page. Easy theme integration is also possible. RSSPhoto includes jQuery-powered, cross-browser compatible slideshow as well as static image display.
RSSPhoto uses the built-in Wordpress functions to parse RSS and Atom feeds (which are based on SimplePie). A cache directory, writable by the server, is required for thumbnail storage. The GD library is required for generating thumbnails.
Installation
RSSPhoto install simply requires creating a writable directory (default location wp-content/cache) to store thumbnails, and installing/activating the plugin itself:
- If it doesn’t already exist, create the directory `/wp-content/cache` and give it permissions of 755
- Upload all files to the `/wp-content/plugins` directory (consider creating an rssphoto subdirectory to hold the plugin files)
- Activate the plugin through the ‘Plugins’ menu in Wordpress
To use the widget:
- Navigate to the ‘Widgets’ section of the ‘Appearance’ menu in Wordpress
- Drag the widget to the sidebar
- Configure the widget as needed
To use the shortcode:
- Edit the page you want to display the images
- Add the following text to the page:
[rssphoto url="your.url.com"]
- Include any of the following attributes (see descriptions of these settings below)
- title=”Title”
- url=”http://your.url.com/feed.xml”
- height=150
- width=185
- img_sel=”Most Recent”
- num_img=1
- item_sel=”Random”
- num_item=10
- show_title=1
- show_img_title=1
- output=”Slideshow2″
- interval=6000
- min_size=10
- max_size=500
To integrate with a theme:
- The plugin needs to be installed and activated.
- Copy and paste the contents of the file RSSPhotoTheme.functions.php to the end of the file functions.php in your theme directory.
- Declare RSSPhoto settings (multiple instances are supported).
- Call the function display_rssphoto() from your theme (e.g., sidebar.php). An example of the last two steps:
<?php $settings[0]['title']='RSSPhoto'; $settings[0]['url']='http://photography.spencerkellis.net/rss.php'; $settings[0]['output']='Slideshow'; $settings[0]['num_item']=10; $settings[0]['interval']=10000; $settings[0]['fixed']='Height'; $settings[0]['size']=80; $settings[0]['before_title']='<h2>'; $settings[0]['after_title']='</h2>'; $settings[0]['before_html']='<li>'; $settings[0]['after_html']='</li>'; display_rssphoto($settings[0]); ?>
Here’s a quick description of the settings:
- (title) Title: Text that appears over the RSSPhoto image(s). “String in quotes”
- (url) URL: address of the RSS or Atom feed. “http://your.url.com/feed.xml”
- (height) Height: height of the RSSPhoto images in pixels; or, ‘variable’ to maintain the aspect ratio given the specified width (see #4). [Number]|”variable”
- (width) Width: width of the RSSPhoto images in pixels; or, ‘variable’ to maintain the aspect ratio given the specified height (see #3). [Number]|”variable”
- (img_sel) Image selection: the script can randomly select images or just display the first image in the feed item. “Random”|”Most Recent”
- (num_img) # Images per Item: how many images embedded in each feed item to display. [Number]
- (item_sel) Item Selection: RSSPhoto will choose a random feed item, or the most recent feed item. “Random”|”Most Recent”
- (num_item) # Items: choose how many feed items to display. [Number]
- (show_title) Show Title: whether to display the main RSSPhoto title over the images. 1|0
- (show_img_title) Show Image Titles: whether to display the titles of each displayed thumbnail. 1|0
- (output) Output: images will load as a slideshow or can be displayed statically. “Slideshow2″|”Slideshow”|”Static”
- (interval) Slideshow Interval: the amount of time in milliseconds to wait between image transitions for the slideshows. [Number]
Frequently Asked Questions
How do I change the title, feed URL, or dimensions for a widget?
After your widget appears in the sidebar, go to the ‘Widgets’ section under the ‘Appearance’ menu in Wordpress and open the settings for the widget (click the down arrow in the widget titlebar and the form will appear). Modify the fields as needed and click save.
Is there a way to prevent very small images from being displayed?
Yes, you can set a variable to require a minimum size (in pixels) of either width or height. In RSSPhoto.class.php, look for
var $min_size = 10;
And change the value as needed (default is 10 pixels).
My feed doesn’t display any photos and there are no problems with the feed validation
RSS feeds can be implemented in numerous ways. RSSPhoto attempts to intelligently find the pictures in an RSS feed, but sometimes you need to point it in the right direction. In RSSPhoto.class.php, try changing the value of the variable $rss_type_src to one of the following values: ‘Choose’ (default), ‘Description’, ‘Content’, or ‘Enclosures’.
My feed doesn’t display any photos; W3C Feed Validation says it’s valid but has a warning about wrong media type
If you get a warning from the W3C Feed Validation Service about your feed being served with the wrong media type, and RSSPhoto doesn’t display your images, you may need to install the SimplePie Core plugin and force RSSPhoto to use it. The integrated SimplePie refuses to parse the feed because of the incorrect media type. Follow the FAQ point below to enable SimplePie Core. Then, open RSSPhoto.class.php and set the $force_feed variable to true:
var $force_feed = true;
How do I force RSSPhoto to use the SimplePie Core plugin so I have access to more feed-level options for troubleshooting?
To be clear, this option is available for fringe cases and is not expected to be commonly used (hence getting down and dirty with the code). An example is where the XML feed does not set its headers correctly and the SimplePie “force_feed” option must be set.
First, de-activate RSSPhoto. Next, install and activate the SimplePie Core plugin (not the full SimplePie plugin).
Now, edit RSSPhoto.class.php and change the value of the variable $parser from ‘built-in’ to ’simplepie-core’:
var $parser = 'simplepie-core';
Re-activate RSSPhoto. That’s it!
I’m getting an error about the SimplePie class not being found. What’s wrong?
This should only happen if you have followed the directions above to force RSSPhoto to use the SimplePie Core plugin.
Here’s what the error might look like:
Fatal error: Class .SimplePie. not found in /home/username/public_html/wp-content/plugins/rssphoto/rssphoto.php on line 40
If you receive this error, the most likely problem is that the SimplePie Core plugin is not installed or activated. Here’s a link to the SimplePie Core plugin.
I’m still having problems. What should I do?
Please feel free to leave a comment below. I usually respond fairly quickly.
If you’re interested in getting your hands dirty, there’s a debug mode you can enable. In RSSPhoto.class.php, set the $debug variable to 1:
var $debug = 1;
By default, the debug output is hidden in HTML comments (<!– and –>), so view the page source to find the debug messages. This could offer some useful information and could help in leaving detailed comments for troubleshooting.
Screenshots


Changelog
version 0.8
- Introduction of Slideshow v2: principal improvement is the ability to fade in and out image titles when the user moves the cursor over the image.
- Simplified method for specifying dimensions: set the width and height directly, and RSSPhoto will automatically general thumbnails without distortion from incorrect aspect ratio.
- Introduction of a debug mode to simplify troubleshooting
- Bug fix: previous versions could generate incorrect paths to the cache when the blog URL and wordpress URL were different, resulting in no thumbnails being displayed.
- Various stability, performance, and bug fixes.
version 0.7.1
- Bug fix: extra HTML tags which distorted the sidebar layout
- Bug fix: removed check for thumbnail cache directory which caused problems in some installs
version 0.7
- RSSPhoto *no longer requires* the SimplePie Core plugin! (but support for using SimplePie Core plugin is preserved). Instead, the Wordpress built-in `fetch_feed` function is used.
- Improved error messages and feedback
version 0.6.8
- Various stability improvements
- Added the (beta-version) capability to show image titles although the option has not been extended to the widget settings UI yet (see FAQ)
version 0.6.7
- Compatibility update for yet another different mime type that means “jpeg”
version 0.6.6
- Stability update: works “out-of-the-box” with all the feeds I’ve encountered so far in troubleshooting, except where SimplePie settings need to be changed
- Performance improvements: removed an http request from the critical path for thumbnail generation
- When embedded images are small, RSSPhoto will now allow upscaled locally cached thumbnails (previously, images would not be displayed at all)
- Added support for wordpress.com feeds
version 0.6.5
- Improved RSS parsing code to handle more implementation varieties (specifically better handling of enclosures)
version 0.6.4
- Added support for MobileMe (Apple) RSS feeds
version 0.6.3
- Added support for theme integration
version 0.6.2
- Added a method for retrieving images from different portions of an RSS 2.0 feed (Atom feeds remain the same)
version 0.6.1
- Add support for images contained in RSS enclosure tags
- Fixed an annoyance where slideshow would play with only one image
version 0.6
- Add shortcode support allowing RSSPhoto to be displayed on any page
- Further improved code organization, separating RSSPhoto code from shortcode and widget code.
- Re-introduced multi-widget support
version 0.5
- Added jQuery slideshow option (default)
- Intelligently selects content or description tag based on feed type
- Streamlined options to make widget configuration simpler
- Improved code organization with better class structure and readability
- Separated Javascript, CSS, and PHP; separated HTML internally
- !Important: Removed multi-widget support!
- Added support for solution to display images from a feed with incorrectly identified media type
version 0.4
- Added support for multiple images and multiple feed items
- Added support for filtering out images smaller than a user-defined pixel value (height or width)
- Reconfigured to the Widget options panel to reduce the height
version 0.3.3
- Added support for PNGs and GIFs
version 0.3.2
- Improvement on previous bug fix to use bloginfo ‘wpurl’ variable to form thumbnail URL
- Separate out image selection from feed item selection (so you can select a random image from the most recent feed item or vice versa)
- Improve the display of the Widgets settings as more options were becoming available
version 0.3.1
- Major bug fix with thumbnail URLs pointing to the wrong location
version 0.3
- Allow multiple RSSPhoto widgets to be present simultaneously
- Selection of fixed width, height, or max dimension for thumbnails
- Selection of pulling images from Content tags or Description tags from feeds
- Fixed a bug where changing the thumbnail size wouldn’t be reflected due to cached thumbnails with the same filename
version 0.2
- Rolled up all other bug fixes from 0.1.* plus fixed a bug where there was no default value for the Image Selection field.
version 0.1.2
- Fixed a bug where the title may not have been saved properly
version 0.1.1
- Fixed an issue where the Max dimensions field had the wrong label
version 0.1
- Original version
- Specify widget title
- Accepts any RSS or Atom feed URL
- Customize thumbnail size
- Select random or most recent image selection method
- jQuery image sliding effects with graceful degradation to plain Javascript
Download
Download the most recent version here.
Donate
If you use this plugin and feel like it’s been helpful to you in a meaningful way, please feel free to donate in return. I accept donations through PayPal.










#1 by Chris on December 1st, 2009
Now I’ve found out, that in the RSSPhoto.class.php under “RSSPhoto settings” everything has no effect on the code of the page; I guess, it’s only for the widgets?
I would like to show in the page about 2 rows of 3 or 4 thumbnails at each row, no slideshow.
So much trouble for your morning? You come from Utah?
Here’s Germany calling
#2 by Chris on December 1st, 2009
By the way: it works in a post, too:
http://kunstblog.birgit-heinz.de/2009/11/test/
But there is also the problem, that RSSphoto shows the images always above all test, althoug I have written the text BEFORE the RSSphoto-code:
Code in the post: http://pastie.org/722053
looks like this: http://kunstblog.birgit-heinz.de/2009/11/test/
#3 by Spencer on December 1st, 2009
Hey @Chris -
Almost there…
I think I’ve fixed the shortcode. That was a mistake in how I implemented the code. The fix is in the dev release at http://downloads.wordpress.org/plugin/rssphoto.zip.
To configure shortcodes, you pass attributes just like for HTML elements. So to set the width and height:
[rssphoto width=300 height=150]
The complete list of options is available in the installation section, #3 under “To use the shortcode:”.
Thanks,
Spencer
#4 by Chris on December 1st, 2009
Hi Spencer,
thanks a lot for your time and support – it works, I’m really happy about it
There’s still something, I don’t understand: what is the difference between “item” and “image”?
And adding this code to the page shows always the title – if I set it to “0″ or “1″, the title is always shown:
http://pastie.org/722416
How can I hide the title?
#5 by Chris on December 1st, 2009
I don’t know, how to write the code concerning the “Most Recent” images there. I wrote it with quotation marks, then without – but it shows the images randomly instead of really only the last 4 images.
The code now:
[rssphoto url=http://vi.sualize.us/rss/csign/malerei/ output=Static item_sel="Most Recent" num_item=4 width=240 height=variable show_title=0 showimgtitle=0]
Problem: the title is not hidden (if I set “1″ instead of “0″, it is also shown), and the images are shown randomly but not the last 4 one.
Have you any idea, what the reason for this is?
Thanks
#6 by Spencer on December 1st, 2009
Hey @Chris – sorry, that should be show_img_title not showimgtitle. Evidently the markdown interprets underscores as italics so they didn’t show up!
#7 by Spencer on December 1st, 2009
@Chris, also about the “Most Recent” problem – do single quotes work?
#8 by Chris on December 1st, 2009
thanks a lot, show_img_title for hiding title works fine. I just test the “most recent” problem … wait a moment …
#9 by Chris on December 1st, 2009
Comparing with this site and the order of the images, I had no success, to show only the last (= most recent) 4 images.
The code:
[rssphoto url=http://vi.sualize.us/rss/csign/malerei/ output=Static img_sel="Most Recent" item_sel="Most Recent" num_item=4 width=240 height=variable show_title=0 show_img_title=0]
I’ve tried to set “Most Recent” between double quotation marks, single quotation marks and without them, none of this options shows actually the “most recent”; loading the page new, it shows a new selection of images.
#10 by Chris on December 1st, 2009
P.S.:
This is the order, the images should be = the most recent:
http://vi.sualize.us/csign/malerei/
#11 by Spencer on December 1st, 2009
@Chris,
For now I’ll provide a workaround while I consider the best way to fix this in the code.
1. In RSSPhotoWidget.class.php, change line 47 from
‘img_sel’ => ‘Random’,
to
‘img_sel’ => ‘Most Recent’,
2. In the same file, change line 49 from
‘item_sel’ => ‘Random’,
to
‘item_sel’ => ‘Most Recent’,
That should do the trick. Then just leave off those options from the shortcode like this:
[rssphoto url=http://vi.sualize.us/rss/csign/malerei/ output=Static num_item=4 width=240 height=variable show_title=0 show_img_title=0]
#12 by Chris on December 1st, 2009
Thanks. Do you really mean RSSPhotoWidget.class.php?
I have there nothing in line 47 or 49 like you’ve mentioned above?
#13 by Chris on December 1st, 2009
By the way:
Activating “Most recent” in the sidebar widget (static), the order is right: just the newest images.
Only the code in the page itself shows the images randomly.
#14 by Chris on December 1st, 2009
Perhaps the code in the page itself doesn’t like the space within “Most Recent”?
#15 by Chris on December 1st, 2009
In RSSPhotoWidget.php I have nothing concerning “img_sel” in line 47 or 49, but many, many other times this appears, so I don’t know, where to change it exactly.
Or do you mean the RSSphoto.class.php?
There I’ve changed in line 67+69 from “Random” to “Most Recent”; but this has no effect on the order of the images at the page.
It’s the same as I’ve mentioned some comments ago, where I’ve tried to change exactly there the Slideshow to static – it hasn’t worked, too, what I changed there in the RSSphoto.class.php.
#16 by Spencer on December 1st, 2009
So sorry about that, I meant RSSPhotoShortcode.class.php
#17 by Chris on December 1st, 2009
Juhu, it works! Thank you so much for so much time and support!
Uff, now I just have to play around with the stylesheets.
Do you think, it is difficult to add to CSS-file an overly for the static images like you’ve done it for the slideshow2?
#18 by Chris on December 1st, 2009
I’ve just add this code to RSSPhoto.class.php, copying it from slideshow settings there:
http://pastie.org/722668
So far, so good – the titles are now links.
Then I’ve tried to copy the title_overlay style from your CSS concerning Slideshow2 to the static code:
http://pastie.org/722674
But this shows it not as semi-transparent, hovering image title as you have done it within Slideshow2 CSS code.
Do you have any idea, what I have done wrong?
I’ll be back tomorrow, it’s midnight again
#19 by Spencer on December 2nd, 2009
Hey @Chris,
The first problem is that line “display: none;” which makes all the titles invisible.
You’ll run into another problem though which I ran into and haven’t had time to figure out yet – once the titles are displayed, because of that “position:absolute;” and the “top:1px;” they will all be overlapping in the top of the rssphoto_static div. This is exactly what it should be for the slideshow, since the images all overlap there too. But in the static display that’s not what we want.
Unfortunately I won’t have time for a couple days to figure this out! If you come up with a good solution, let me know.
Thanks,
Spencer
#20 by Chris on December 2nd, 2009
Thanks, I’ve tried near the whole day, but I’m not so really familiar with CSS. I’ve simulated this image situation in my Adobe Golive, but I wasn’t able to create working, that the static images show a transparent title in it, when hovering over the image
I guess, that it’s not only a problem of CSS, but of adding or removing or changing code in the php-file. And for this I don’t know anything about PHP.
I’ve found a tutorials for this “sliding captions”, but for this the code of the php would have been to change – too difficult for me:
http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/
Let me know, if you have a plugin’s update concerning your workaround from comment #11.
Thank you very much for having so much time for troubleshooting these days
#21 by Chris on December 9th, 2009
Hi Spencer, it’s me again
I have now put your plugin in sidebar with the title “daily inspiration” and would show there randomly the photos from http://vi.sualize.us/csign/ (the feed URL for this is http://vi.sualize.us/rss/csign/)
I used your widget for this, with Slideshow2, Item selection is random, image selection is random and the amount of images is 50 for images and items.
But I have still 2 problems:
the images are shown, are the recent images, not randomly and there are only shown the last 15 and not randomly from a selection of 50 images (there are indeed 50 available).
I checked your debug source code; it says:
…
In function check_thumbnails(), there are 15 images in $this->images; setting status to 1
RSSPhoto v0.8.2 debug output END
Concerning the “most recent” or “random” I checked the RSSPhoto.class.php and set “Random” from line 60 on in the “RSSPhoto settings”.
In RSSPhotoShortcode.class.php is also “Random” under user-defined options.
How can really more than 15 images been shown as I’ve set in the sidebar widget? 50 is ignored, 20 is ignored, it shows always only 15 images.
And how can I set the order to indeed random, not the most recent? The settings in the widget are ignored and in the 2 php-files of your plugin (see above), too?
Thanks again for your help.
#22 by Chris on December 9th, 2009
I forgot, the site to check for you:
http://kunstblog.birgit-heinz.de/
right sidebar under “Daily Inspiration”
#23 by Chris on December 9th, 2009
… and another hint: I’ve used your new version 0.8.2
#24 by Chris on December 9th, 2009
I’ve just discovered a bad thing :
I suppose the limit of 15 images showing with your sidebar widget comes from the RSS feed itself
I just called the RSS URL http://vi.sualize.us/rss/csign/) and it shows only 15 images
OK, that problems seems to be solved, or have you another idea?
Second problem remains, to show images in sidebar widget randomly not most recent?
#25 by Spencer on December 13th, 2009
Hi Chris,
Sorry it took me so long to get back to you! This has been a very busy few weeks. On the random display of images, one thing to check first: there are two things to specify “random” or “most recently” – one is selection of feed items within the feed, and another is selection of images within a single feed item. You’d want to select random for “Item Selection”. “Image Selection” in your case doesn’t matter since there is only one image per feed item.
I suspect that’s the problem because I verified the random selection was working on my website. I’ve been feeling like those labels are kind of confusing/misleading. I’ll have to think about how to change them.
Let me know if that fixes the problem -
Thanks,
Spencer
#26 by Silke on January 6th, 2010
hi, thx for this great plugin, i will try it!