Blog

Flickrpress: WordPress Flickr widget

Flickrpress screenshotFlickrpress is a widget/shortcode function to display items from Flickr in the sidebar or within pages and posts. This widget supports:

  • Flickr RSS feeds
  • Photostream
  • Filtering by tag
  • One or more photosets
  • Favorites
  • Displaying random items

Other features:

  • Choose from three different thumbnail types
  • Lightbox/Thickbox are supported
  • Data is cached locally to lower server load
  • Secure Flickr API used, to eliminate the risk of damage to your server, unlike some other Flickr widgets
  • Flickrpress is a multi-widget, so you can use more than one instance (e.g., one in your sidebar, one in your footer)
  • Use as a shortcode to insert into posts and pages — multiple instances supported in the one entry

Flickrpress uses the excellent phpFlickr library.


My latest project:

The Cartographer banner


Download

Download Flickrpress at the WordPress site.

If you like Flickrpress, please consider buying one of my products.

Installation

  1. Unzip the package, and upload flickrpress to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Add the ‘Flickr Widget’ to your sidebar and configure, or see the ‘Shortcodes’ section for information on use in pages and posts

If you wish to use content from anything but an RSS feed, you will need a Flickr API key. This can be obtained from Flickr

If you wish to use Lightbox, you must first install the Lightbox plugin.

Shortcode

Shortcodes are snippets of text that can be inserted into pages and posts. These snippets are replaced by various generated content. Flickrpress provides a ‘flickrpress’ shortcode to display images from Flickr within a page/post.

Available parameters:

type One of: ‘rss’, ‘photostream’, ‘sets’, ‘favorites’
url URL for RSS feed
api_key API Key for types other than RSS
account Account name, email or ID
sets Comma-separated list of photoset titles
tags Comma-separated list of tags to filter by (for photostream view)
view One of: ‘squares’ (view as squares), ‘proportional’ (proportional thumbnails) , ‘large’ (large thumbnails)
count Number of thumbnails to display
paging ‘true’ to show page navigation, to move back and forward through pages of images (implemented using AJAX)
random ‘true’ to display randomly
lightbox ‘true’ to use Lightbox
columns Number of columns of images to display

Example:

  [flickrpress type="photostream" api_key="xxxxxxxxxxxxxxxxxxxxxx" account="michaeltyson" count="30" paging="true" lightbox="true"]

Styling

Flickrpress comes with CSS styling, but if you wish to modify its appearance, such as adding frame borders, simply style the “flickrpress-container” class. See style.css for more.

FAQ

I’m seeing “Flickr is currently unavailable” messages

You may have an incorrect setting: To see the actual error message, open your server’s error log and look for Flickrpress messages. How you do that depends on your host – on mine, Site5, the error log appears in the WordPress folder; on others, you access it through a web interface). If you can’t get to it, open up the file includes/interface.php in the plugin’s folder, and change error_log on line 22 to echo – then any messages will be printed to the screen. You’ll want to change it back afterwards so your visitors don’t see those messages.

Changelog

1.0.2

  • Added Thickbox support
  • Compatibility fix for PHP 4

1.0.1

  • Bugfix in navigation javascript encountered when Lightbox isn’t installed

1.0

  • Implemented AJAX-based navigation through pages of images
  • Added shortcode documentation
  • Caching for shortcode and php calls
  • Removed ‘css’ option in favour of always including CSS
  • Fixed conflict between shortcode and widget versions
  • Fixed bug in loading all photostream items

0.3.2

  • Fixed a warning when using shortcode

0.3.1

  • Fixed a packaging snafu

0.3

  • Support for use outside of sidebar

0.2.1

  • Bugfix for displaying random favourites

0.2

  • Now able to be styled as described in http://www.webdesignerwall.com/tutorials/css-decorative-gallery/. See style.css for more info.

0.1.1

  • Bugfix for when only 1 random image shown

0.1

  • Initial release
Tagged , , . Bookmark the permalink. Both comments and trackbacks are currently closed.

276 Comments

  1. Posted June 6, 2009 at 12:25 am | Permalink

    Hi I went to get this via the link but it's an FYI at wordpress.org:( Great thing you have offered here:) Cheers Lee

  2. Posted June 6, 2009 at 3:18 pm | Permalink

    Nice plugin. However, I'd like to just show one photograph; when I changed the settings to '1', I receive this error message from the plugin: Warning: Invalid argument supplied for foreach() in /home/tworedbo/public_html/blog/wp-content/plugins/flickrpress/includes/interface.php on line 125 I don't know anything about coding – can you help please?

    • Posted June 6, 2009 at 3:35 pm | Permalink

      Ah, thanks for letting me know! I hadn't tested for that. Version 0.1.1, just released, will fix it

  3. Posted June 7, 2009 at 12:43 am | Permalink

    Brilliant:)

  4. Posted June 7, 2009 at 1:30 am | Permalink

    Works great, thank you

  5. Posted June 9, 2009 at 11:46 am | Permalink

    Thanks for the fun plugin! Only problem I am having is when I choose the Display Random option, no pictures appear. If I uncheck it, it works fine. You can see it here – http://5yrplan.com/category/blog/

    • Posted June 10, 2009 at 7:04 pm | Permalink

      Thanks for the feedback! To help me chase down the bug: When this happens, what other settings are you using? RSS, photostream, photosets, or favourites? (Wow, that's a beautiful WordPress theme..)

      • Posted June 11, 2009 at 12:27 am | Permalink

        I can only use Favorite Photos currently, as I don’t have any personal photos up on Flickr. So that’s what it’s set on.

        • Posted June 12, 2009 at 11:05 pm | Permalink

          Ahh yes, I see the problem – Please upgrade to 0.2.1 and let me know how it goes.

          • Posted June 13, 2009 at 2:08 am | Permalink

            It’s now working perfectly. Thanks for the quick response! Great plugin!

  6. Posted June 11, 2009 at 6:11 am | Permalink

    Hi, I can’t get the plugin to display my photos. Do I have to get a new API key (as opposed to the one I already have?). I’ve messed with all the settings, and can’t get anything to show. You can see it on my home-page – http://www.andreachristensen.com. THANKS!

    • Posted June 12, 2009 at 11:09 pm | Permalink

      Hi Andrea – your existing API key should certainly work. Try updating to 0.2.1 (there was a bug in 0.2 that stopped random favourites from working). If it still doesn’t work for you, let me know what your configuration is (RSS, photostream, photosets or favourites, and random or not) and I’ll see if I can get to the bottom of it.

      • Posted June 13, 2009 at 2:23 am | Permalink

        I am updated to 2.1. I also have unactivated Flickr Photo Album, another flickr plugin that I would like to use, but deactivated to see if that was the problem. It’s still not working. My configuration is this:

        Title: Flickr Display: Photos from Photosets Flickr API: My API KEY Account Name/email: My email Photosets: Spring, (I originally had my photoset called ‘Apr – Jun 2009′ but changed it to ‘Spring’ to see if there was a problem with the spaces or dash in the title. That didn’t solve it either) Number of thumbnails: 4 Display Random: UNCHECKED View as Square Thumbnails: CHECKED Use Lightbox, etc.: CHECKED Add CSS Styling: CHECKED

        Email me and I’ll give you access to my wordpress back-end, and you can take a look yourself if you think that will help.

        Thanks, Andrea

        • Posted June 14, 2009 at 12:35 pm | Permalink

          Hi again! Have you tried displaying just your photostream, to see if that works? If it does work, there may be problems with finding the photosets.

          See my comment at the bottom of the page in response to Christopher for info on how to get at any messages coming from the plugin, and let me know if there’s anything showing up.

          Cheers!

  7. Posted June 11, 2009 at 8:53 am | Permalink

    I think I must be missing a brain cell or two. I activate the plugin, it shows as activated… and then what? I don’t see anywhere to configure the plugin. For example, the stuff in screenshots 1 and 2, where are those configuration panels? My other plugins have configuration panels in the WP settings area, but there doesn’t appear to be one for flickrpress even though the plugin is showing as activated. Am I doing something wrong?

    • Posted June 12, 2009 at 11:11 pm | Permalink

      Hi Melissa – you will need to go into ‘Appearance’ and ‘Widgets’, then click ‘Add’ beside the ‘Flickrpress’ widget to add it to your sidebar. For more information, see the WordPress documentation on widgets

      • Posted June 12, 2009 at 11:30 pm | Permalink

        Aaaaaaaaah, thank you. Oh man, this plugin is excellent. Way better than… well, let’s just say way better than its competitors. I’ll be unveiling it this weekend when I take my new blog layout live.

  8. Posted June 12, 2009 at 12:43 am | Permalink

    I just added the plugin love it. I am wondering howcome your thumbnails are so small. I would like to make mine also small. Right now they are little big. Also a new feature would be to show few pics but once someone clicks on it the lightbox open and clicking next on it gets more pics from flickr. Right now it just shows you those 4-5 pics which you are displaying on the website. thanks.

    • Posted June 12, 2009 at 11:14 pm | Permalink

      Hi Gaurav,

      I’ve styled the thumbnails in my sidebar with some css (see my personal page, and the style.css within the plugin folder for another way to style them even more, with a custom frame)

      The css I’m using in particular is:

      .flickrpress-container { overflow: none; }

      .flickrpress-container div { float: none; display: inline-block; margin: 2px; }

      .flickrpress-container img { width: 42px; }

      • steve
        Posted August 16, 2009 at 3:44 am | Permalink

        My style.css file is inactive and I cannot figure out ho to activate it. Also, any tricks to getting lightbox to work? I’m new to this and installed Lightbox2, but photos still open to a new page away from blog (i.e. no lightbox window). Also curious how you embed photos in your posts on your personal page to look the way yours do. Cool stuff. Thanks.

  9. Christopher
    Posted June 14, 2009 at 4:35 am | Permalink

    Using WPMu 2.7.1 this widget works wonderfully for services using API, but when I use rss it displays this error in place of the photos in the sidebar:

    Warning: Invalid argument supplied for foreach() in /home/mydirectory/public_html/wp-content/plugins/flickrpress/flickr.php on line 74

    • Posted June 14, 2009 at 12:32 pm | Permalink

      D’oh. Sounds like there’s either a problem with the RSS feed, or a problem with WordPress’s RSS feed loader (maybe).

      Do you have access to your web server’s error log? If so, that’s where errors from the plugin are reported. If not, you can force the plugin to output errors to the screen by opening up interface.php, and changing the words error_log to echo on line 22.

      If you still don’t see anything, let me know, and also let me know the RSS address you’re using.

  10. CBusquets
    Posted June 15, 2009 at 2:13 am | Permalink

    Hi Michael! I like your WordPress plugin, but I have a problem. When I click on a thumbnail, lightbox doesn’t work and I have selected it on widget’s page. I use WordPress 2.7.1 in spanish, I hope you can help me.

    Thank you! :)

    PD: http://www.cbusquets.com/blog

    • Posted June 16, 2009 at 7:12 pm | Permalink

      Hi C,

      It looks like lightbox just isn’t working on your site – I don’t know how to fix it though, I suggest you ask on the WP forums.

  11. Posted June 18, 2009 at 2:28 pm | Permalink

    I love your plug-in. I am using it as a sidebar widget on my WordPress page to display random images from a Flickr portfolio set.

    I have the lightbox option disabled so clicking a thumbnail opens the photo’s Flickr page. Is there an easy way to make that page load in a new window?

    Also, is there a way to make only one photo display on each line? In a listing of four photos, proportional thumbnails in landscape orientation display fine, but back-to-back portrait thumbnails display two on a line.

    It would be nice to specify the width of each photo displayed so the column edges of landscape and portrait orientations align, but perhaps I’m making too many requests. Thank you for a great plug-in.

    • Posted June 19, 2009 at 6:50 am | Permalink

      Hello again. I am researching my own questions but still appreciate your input. The Lightbox 2 widget provided the page overlay functionality I was looking for (I wasn’t familiar with Lightbox until now).

      I am looking through the plugin code to find where image size/display is specified. Any pointers on where to change width are welcome. Thanks.

      • Posted June 21, 2009 at 12:43 am | Permalink

        Sorry, I did not notice your reply to Gaurav until after my post. That CSS with minor adjustments works great for displaying a vertical strip of photos. For anyone making rectangles instead of squares, the only recommendation I would add is to change the display option from proportional to large, then downsize from there.

  12. Posted June 30, 2009 at 1:59 am | Permalink

    Hi Michael. Tested a few of these plugins and arrived at yours and it is working so far. Thanks. I was just wondering where i would go to remove the ‘Flickr’ heading that appears. I can’t seem to find it in your code.

    Thanks

  13. Posted June 30, 2009 at 7:10 pm | Permalink

    To get rid of the gallery heading it appears I have to put a space for the name of the gallery or remove the title with css, as if i enter nothing for the title it breaks.

    No Problem just good to work out how to do it

  14. Posted July 3, 2009 at 3:21 am | Permalink

    Hi Michael, thanks for this nice plugin. I use it to show my favorite collections. The lightbox does not work in my blog so I try to uncheck that option. After that, it links that picture under my photostream but not the original author. Could you check the code to fix it?

  15. Posted July 6, 2009 at 6:16 pm | Permalink

    Wooo, this is a fantastic plugin. One issue I can’t solve on my own yet… I’d like to display a single, random SQUARE thumbnail (using rss feed) at a size of 200×200.

    I saw the css trick you detailed previously, but that only seems to resize-up an already shrunken photo, so I’m left with a highly-artifacted, blurry 200×200 pic.

    Where do I edit to get a 200×200 cropped single thumbnail?

    • Posted July 7, 2009 at 11:46 am | Permalink

      Actually, Flickr doesn’t have support for that image size. Instead, you’ll probably want to select the ‘medium’ image size (or something), then use CSS to define a 200×200 box in which it sits. Maybe something like

      `.flickr_item { width: 200px; height: 200px; overflow: hidden; }’

  16. Posted July 14, 2009 at 2:09 am | Permalink

    Hello Michael,

    ive installed your plugin, however, Im having an issue displaying the photosets. I have separated them by commas, and have added the appropriate number of thumbnails, but it seems to be only grabbing from the first photoset in the list.

    Please advise what may be the error. Thanks in advance!

  17. alyssa
    Posted August 10, 2009 at 8:06 am | Permalink

    This just won’t work for me at all. :(

    API gets nothing displayed at all – no matter what the settings.

    RSS results in an error: Warning: Invalid argument supplied for foreach() in /home/domainname/public_html/wp-content/plugins/flickrpress/flickr.php on line 74

  18. Matt
    Posted August 12, 2009 at 9:57 am | Permalink

    can I manually include the widget, as an example in a static php-footer-page, without using the dynamic widget configuration? how? thx for your help!

  19. Matt
    Posted August 12, 2009 at 9:58 am | Permalink

    can I manually include the widget, as an example in a static php-footer-page, without using the dynamic widget configuration? how? thx for your help! sorry, forgot to check the notifiy-button …

  20. Posted August 20, 2009 at 1:18 pm | Permalink

    thx for the plugin, i’m trying to use this one instead, anyway is it valid XHTML?

  21. Posted August 30, 2009 at 8:33 pm | Permalink

    I’d love to use this for the random image wonderness, but currently, when I enter comma separated tags, (ie “flowers, yellow, bee”) it is pulling a random photo with any of the tags rather than all of the tags.

    Any chance that there will be support of pulling photos that must include all tags selected?

  22. thibault
    Posted September 2, 2009 at 5:46 pm | Permalink

    Hi great plugin thank you..

    Same question as “Matt” !!

    How can I include the plugin manually ? As I don’t use widget side bar.

    Thanks

  23. Posted September 5, 2009 at 4:27 pm | Permalink

    Hi Michael, This plugin is fantastic…one small issue. I’m the admin for my Flickr group. I use the RSS feed flavor of your plugin on my site to display photos submitted to the group…only problem is, it won’t display any photo that I submit, even though that photo is showing up as part of the group pool….any ideas? Thanks!

  24. Posted September 5, 2009 at 4:29 pm | Permalink

    Hah! Well, never mind…after 30 minutes, the photo just showed up! Later :-)

  25. D-dig
    Posted September 11, 2009 at 9:01 pm | Permalink

    How can I put the plugin in my template?

  26. Steve Edson
    Posted September 13, 2009 at 8:22 pm | Permalink

    Please could you tell me how it is possible to display the small thumnails in the sidebar like on your page? They are appearing fairly large and on 2 rows when displaying 4.

  27. Posted September 14, 2009 at 3:08 am | Permalink

    On my site it’s simply a function of the widget options. I have the box filled out with the number of photos I want to display at “8″ and the widget takes care of the rest. May be a function of my rail width also.

  28. Kate
    Posted September 19, 2009 at 5:52 am | Permalink

    This plugin is not working for me… it did originally but then I switched my API. It will not work with the new API key, even though I have triple-checked all of the settings (on WordPress and on Flickr).

  29. John
    Posted September 23, 2009 at 1:02 pm | Permalink

    Hi Michael

    Great widget – but so far the lightbox functionality isn’t working. Do I need to install “lightbox” for WordPress first?

    Thanks John

  30. Posted October 5, 2009 at 9:33 pm | Permalink

    Thank you for the great widget! Saved me a lot of time.