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
, , . Bookmark the permalink. Both comments and trackbacks are currently closed.

55 Comments

  1. Posted December 1, 2009 at 10:26 am | Permalink

    Whoops, meant the < li > tags.

  2. Posted December 5, 2009 at 1:41 am | Permalink

    great plugin, I’ve been looking for something like this for a long time. I’ve run into two issues though.

    1) I can’t get lightbox to work, I installed lightbox2 and I tried the lightview plus option as stated in this blog in the comment and neither are working. The images are just opening up as a single image instead. Any ideas? I won’t die if this is how it has to be, but I just really like lightbox effect. (ps, i’ve gotten lightbox to work on my flickr galleries within a post/page just not within the sidebar – same issue with other side bar flickr widgets i tried)

    2) I want to use the large images option but I have some horizontal shots. Is there any way to take out the scroll bar that forces it self for horizontal shots and/or to restrict the longest side of the photo to a pixel lenght?

    Thanks so much!!

  3. Troy Templeman
    Posted December 15, 2009 at 4:48 am | Permalink

    Great plugin. Can you tell me the PHP code to use in template files? I know you said it was in the documentation but I don’t see it, sorry.

  4. Posted January 12, 2010 at 11:22 am | Permalink

    Hi,

    I’m currently styling the widget to use in my blog sidebar.. please could you tell me how I can get the thumbs to be totally square (I want the border to be consistently spaced around the thumbs) there is added space at the bottom of the thumbs and I don’t know how to get change this in CSS..

    Looking forward to your reply

    Many thanks!

  5. Posted January 17, 2010 at 2:06 pm | Permalink

    The one thing that the WP community has not come up with is a widget that can group all your profiles for people to follow. I tried this one called follow me and it works ok but I rather do the static image things for now.

    good post

  6. Posted January 19, 2010 at 10:44 am | Permalink

    Great plugin. I love it! Just one remark\bug: when using it in a page (http://www.iz5gsv.it/fotografie/) it appears that when switching to the next page (using the navigation link at the bottom right) the following page is correctly generated, however: a) the navigation links are never regenerated b) the lightbox doesn’t work anymore and clicking on a thumbnail just the photo is displayed.

    More, if I may dare a suggestion for improvement, I would love to have the possibility to open the flickr page by clicking on the image displayed inside the lightbox window (instead having the box closed).

    Keep on the good work!

    —Alex

    • Posted January 19, 2010 at 10:26 pm | Permalink

      Hi Alex,

      You don’t appear to have lightbox installed, unless I’m missing something (I’ve added a link to it above under ‘Installation’). Thanks for the heads-up about the navigation links – I found and fixed the bug, which occurs when there’s no Lightbox installation.

      That’s a good suggestion – I’ll work it in soon.

      • Posted January 19, 2010 at 10:55 pm | Permalink

        Hi Michael, thanks for sorting out my issue. Actually (I don’t know why!) I believed the lightbox was already installed.

        I’ve now installed it and it works perfectly. I’ve also updated the plugin to version 1.0.1 and the navigation links are now OK.

        Thanks again!

        —Alex

  7. Posted January 19, 2010 at 11:08 pm | Permalink

    I said that too quickly.

    When used in a page it does have a strange behaviour: To reproduce the issue: a) open the page (http://www.iz5gsv.it/fotografie/) b) click on a thumbnail, it is opened via thickbox c) navigate to the next page and click on another thumbnail, the photo is opened via lightbox.

    More, sometimes it happens that opening a photo, closing it and opening another one, the thickbox seems to go in a loop with an endless waiting…

    Hope this would be helpful

    —Alex

    • Posted January 19, 2010 at 11:22 pm | Permalink

      Hi!

      Wow, that’s daring of you – Thickbox and Lightbox? I suspect that may come under the heading of ‘unsupported installation’ ;-)

      Try removing Thickbox is all I could suggest – unless I’m missing something, I’m pretty sure they’re not really designed to be run side-by-side.

      Flickrpress keeps Lightbox working across different pages of items by calling Lightbox’s setup routine on the new images – it won’t work with Thickbox, which has a different interface.

      • Posted January 19, 2010 at 11:28 pm | Permalink

        Maybe it is my fault in describing my issues.

        I’ve not installed thickbox, I swear! I just suspected that something different from lightbox was running as the interface I see when clicking on a thumbnail in my sidebar or in the first block of thumbnails in my photo page is visually different from the one I got when opening a thumbnail in the second page of photos onward…

        Maybe I’m unable to explain it clearly (unfortunately English is not my mothertongue…)

        —Alex

        • Posted January 19, 2010 at 11:58 pm | Permalink

          Ah, I see! No, you describe perfectly well – on closer inspection, it looks like something is including Thickbox, but I can’t tell what! Emailing you for more debugging.

          • Posted June 14, 2010 at 8:18 pm | Permalink

            I’m having the same problem as the poster above – can you tell me what the solution is?

          • Posted June 14, 2010 at 8:33 pm | Permalink

            Hi Laurence; Alex let me know afterwards that he had some old thickbox files lying around in his WP installation, possibly from a prior flickr plugin, that were interfering. He cleaned them out manually and then everything was fine.

  8. Posted January 19, 2010 at 11:39 pm | Permalink

    POST SCRIPTUM= looking at your travel blog (enjoy Sicily! if you would ever drive north up to Florence let me know!) I definitively realized that the plugin is not correctly working on my blog. It may be the template or any other strange defect…

    —Alex

  9. Posted January 21, 2010 at 7:19 am | Permalink

    Thank you so much for the updated plugin. Was able to re-activate on my blogs and simply works like a champ now in both pages and sidebar, without conflict.

    Wishing you many miles of safe travels in your adventures.

    Cheers.

  10. Posted January 25, 2010 at 2:00 pm | Permalink

    Hello Michael!

    First, thank you very much for your simple yet incredibly useful plugin.

    I’d like to request a feature, perhaps for a future version: add the option to include a link for the reader to see the rest of your photos on your flickr page, something like “See more of my pictures on flickr” to be shown after the thumbnails in the sidebar.

    That would be sweet!

    Regards from Brazil!

    • Posted January 25, 2010 at 6:04 pm | Permalink

      Hi Alexandre,

      Cheers – Glad to help! I’ll work it in; in the mean-time, you may be able to achieve the same effect using a text widget (without a title).

  11. Posted January 31, 2010 at 5:05 pm | Permalink

    Hi Michael, excellent plugin, thank you very much. I wanted to report a minor issue… When using thickbox and an image has an apostrophe in its title, the html/alt text break out. This happens in the actual thickbox, not in the rendered thumbnails.

    Again, thank you very much.

    • Posted February 1, 2010 at 10:44 am | Permalink

      Hi Patrick – great, I’m glad it’s useful to you! I’m not quite sure what you mean there – would you post a link to a page where I can see the problem?

  12. Thad
    Posted February 2, 2010 at 1:28 am | Permalink

    Hi Michael,

    I really like your plugin, but I seem to be doing something wrong. I can only get the RSS feed option to work. I have a flickr API key and I have tried all the different variations on my email address, flicker ID/username in the widget settings. Are there specific options that need to be set on the flickr API key side. In flickr I see options on the key for visibility and authentication flow, do I need to set these up? Sorry, if this is more of a flickr API key question.

    Thanks, Thad

    • Posted February 18, 2010 at 11:35 am | Permalink

      Hi Thad,

      Hmm, are you definitely entering the key correctly? It should be the string beside “Key” (not “Secret”) on the http://flickr.com/services/api/keys page. There is no particular configuration needed on the Flickr side, it should just work!

  13. Mike R
    Posted February 9, 2010 at 4:29 pm | Permalink

    Hi and thanks for the excellent work. We love the ease of use with your plugin. My wife thanks you immensely as well. We did have one question, is there a way to use the plugin to show pictures that are marked private on Flickr? We were thinking about changing most of our pics to “friends-only” on Flickr but would still like to show select ones on our WordPress-site w/o having to turn off privacy for them.

    • Posted February 18, 2010 at 11:37 am | Permalink

      Hi Mike,

      Great, I’m very pleased you like it! No, I’m afraid there’s not currently a way to show private images; I’ve added it to my to-do list, though, so I’ll work it in when I get time.

      Cheers, Michael

  14. mitch
    Posted February 10, 2010 at 5:02 am | Permalink

    I’ve been really liking the changes to make this work in both sidebars and pages, thanks for digging into this while on your adventure.

    I have two questions, if I may…

    1). How do I change the size of the image loaded on the screen when using lightbox = true

    2). How do I make the thumbnail sizes different for the widget vs. page application. (Say I want 150 x 150 images on a page, but only want 90 x 90 images in the sidebar).

    Thanks again for making the best flickr plugin out there.

    Safe travels.

    • Posted February 18, 2010 at 11:55 am | Permalink

      Hi Mitch – great, glad to help!

      1. I’m not actually sure you can – this comes straight from Flickr. Maybe there’s an option at Flickr? It would be possible to downsize images, but that’s probably not what you had in mind. I”m not sure, I’m afraid
      2. The easiest way to do this is via CSS – style the .flickrpress-container .flickr_item_view_squares img elements. Something like: .your-sidebar-classname .flickrpress-container .flickr_item_view_squares img { width: 90px; }, I think. That won’t size up beyond 75px, the size of the squares thumbnail type. If there’s enough request, I could implement more control into the plugin itself.

      Cheers! Michael

      • Posted February 18, 2010 at 11:58 am | Permalink

        What’s with my English today? I mean if there’s enough demand. Trying to learn French is pushing my native language out, I think.

  15. Posted February 10, 2010 at 12:40 pm | Permalink

    Hi Michael

    Tried all the permutations listed in these comments, but still can’t get my photo’s to show. Help please!

    • Posted February 18, 2010 at 12:21 pm | Permalink

      You’ll need to be more specific about the issue, Jane.

      • What setup are you after?
      • What is going wrong?
      • If there are any, what errors do you see?
      • What have you tried?
      • What version of WordPress are you using?
  16. Posted February 19, 2010 at 12:44 am | Permalink

    Hello,

    I’m trying to get the shortcode to work inside my footer, everything works on regular pages including slimbox (lightbox like jquery plugin), however the shortcode does nothing in footer besides display the shortcode text.

    Thanks

  17. Ricky Sullivan
    Posted February 24, 2010 at 2:13 pm | Permalink

    I loved the plugin at 1st.

    But now I’m getting this error:

    wordpress/wp-content/plugins/flickrpress/includes/interface.php:84 (flickrpress_load_items()): Couldn’t get account: Invalid auth token Flickr is currently unavailable.

    Tried 2 different app keys now and also different accounts.

    I’ve no idea why it just stopped working.

  18. Ricky Sullivan
    Posted February 24, 2010 at 10:00 pm | Permalink

    Does the plugin handle auth tokens expiring?

    I read somewhere that they can expire in 1 hour if not renewed or handled to do so.

    I’m really not sure what is happeing. I’ve tried uninstalling the plugin and re-installing to see if I mucked up the code.

    This is my shortcode…

    [flickrpress type=”photostream” api_key=”4c544351f1d3cecba3553b5210d8fdb8″ account=”lupusqueensland” view=”squares” count=”10″]

  19. Posted March 9, 2010 at 8:56 pm | Permalink

    Hello,

    the plugin has been funcitoning perfectly on our blog since October, then over the weekend (when we last tried using flickrpress) it has stopped working. It says that our API key is invalid, however, when checking our flickr account the key has not changed. I also tried an alternative one and the settings page tells us it is invalid. What could be the reason for this?

    thanks

    Andrew

    • Posted March 10, 2010 at 8:08 pm | Permalink

      Hi Andrew – how odd! I suggest having a look in your server’s error log for messages from flickrpress. If you can’t get to the error log, try opening up wp-content/plugins/flickrpress/includes/interface.php and change ‘error_log’ on line 22 to ‘echo’ temporarily, to write error messages to the page. That will hopefully give you an idea of what’s going on.

  20. Posted March 15, 2010 at 10:15 pm | Permalink

    Hi Michael, Loaded your plugin into self hosted WP blog at http://www.t-e-g.co.uk/blog/ but cannot get RSS or API versions to work please help! No error messages just FlickR not available! Teg

    • Posted March 15, 2010 at 11:46 pm | Permalink

      Hi Teg – you’ll find any error messages in your webserver’s error log. That should let you know what’s going wrong.

      • Posted March 16, 2010 at 9:52 pm | Permalink

        How do I access the error log? Sorry completely WP newbie here!

  21. Kyndra
    Posted March 16, 2010 at 3:09 pm | Permalink

    Hi Michael – Posted this in your forum but realized I should have posted this here. My apologies.

    Just loaded FlikrPress! Exactly what I needed and I have been searching and searching. Thanks for the great plugin.

    Quick question, can’t figure out how to get the FlikrPress streams to open in a new target window.

    Is this possible? If so, where? I can pretty much figure out how to make things work but I’m not a professional code wrangler.

    Thanks for you help! Kyndra

  22. Posted March 30, 2010 at 4:13 am | Permalink

    Ok, this has now become my favorite Flickr widget. I have been searching for three days trying to find one that did what I wanted and so far this does it all – well, almost. There are only a couple things I would like to do.

    First, I would like to style the title myself – or the area where WP usually puts the h3 title. I can’t figure out how to do this in the Flickrpress code.

    Second, I would like to add some text just below the widget that says something like, “Check out more of Doug’s photos on Flickr.”

    Any suggestions would be great.

    Thank you.

    • Posted April 2, 2010 at 12:52 pm | Permalink

      Doug,

      You should typically post questions like this to the WordPress support forum, where more people will see your question. This is not a support forum and it is unreasonable to expect the turnaround times of one. Furthermore, this is a piece of software I provide free of charge. Expecting me to reply to your question within a couple of days, then posting a petulant complaint is ridiculous.

      In case others have a similar question:

      As far as styling goes, this has nothing to do with the plugin/widget: You will need to edit your theme‘s stylesheet, and I can’t guide you in this, because the structure varies between themes. On mine, I would be styling #l_sidebar .flickrpress h5.

      Two ways to add text below the widget; either add a Text widget straight after with no title, and just type it in, or style the .flickrpress-container box using the :after mechanism; something like .flickrpress-container :after { content: "Text to add goes here" }

  23. Posted March 30, 2010 at 9:17 pm | Permalink

    Well, until someone can help me here I’ll have to go back to using my own hand-coded Flickr widget. Hopefully someone will come along and tell me how to accomplish the two things I asked about in my comment above.

  24. Posted April 2, 2010 at 12:16 pm | Permalink

    Since it doesn’t seem to be a growing concern here to address people’s questions and problems with your widget then I’m just going to delete it. I’ll try something else.

  25. Posted April 2, 2010 at 2:47 pm | Permalink

    Thanks for the reply. I wasn’t aware that I had to go to the WP forums to ask about your widget. Sorry. I tried adding the .flickrpress-container :after with my text, but all that does is add the text below every photo instead of right below the container.

    • Posted April 2, 2010 at 3:15 pm | Permalink

      That’s cool;

      Odd – you could try .flickrpress :after instead, perhaps. If you wanted to post the URL where you’re hosting the widget, I could have a look at the template and see what CSS selector to use.

      • Posted April 2, 2010 at 4:00 pm | Permalink

        I’ve replied via email, but for any others trying this: I made a mistake, there shouldn’t be a space before the “:after” part. So:

        .flickrpress-container:after { content: "Text goes here"; }

  26. Posted April 2, 2010 at 3:43 pm | Permalink

    Thanks, Michael. I sent you a message through your other site, Technomadic.

  27. Posted April 3, 2010 at 10:44 am | Permalink

    Mike, thanks for the great assistance. Now to figure out what conditional tag to use in my Widget Logic to display these on certain pages.

  28. Mo
    Posted April 6, 2010 at 4:29 pm | Permalink

    Hi Michael,

    First let me say that yr plugin rocks.

    I only have one small problem with it, currently the default row of columns is 3, i would like to change that so it will be horizontal 1 row of images as i am not using this in a post or page.

    Im doing a project with the accumulo theme so i need it done this way. here’s screenshot of what im saying:

    Now: http://imgur.com/nxoHD.png

    What i want: http://imgur.com/K5DYp.png

    Thanks!!

    • Posted April 6, 2010 at 5:10 pm | Permalink

      Hi, Mo,

      This will be a styling issue, rather than anything with Flickrpress – it looks like you’re putting the plugin inside a container that’s only 3 thumbnails wide. You’ll want to restructure to put it in a wider container. I suggest trying the WordPress forums for help adjusting the template (or if you have a web developer on hand, get them to do it).

  29. Mo
    Posted April 6, 2010 at 5:35 pm | Permalink

    Thanks for the speedy answer!

    appreciate it much.

    Cheers

  30. Posted April 7, 2010 at 2:06 am | Permalink

    Hi Michael,

    I keep getting this error msg:

    “Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/content/34/5505134/html/test/wp-content/plugins/flickrpress/flickr.php on line 109 Flickr is currently unavailable.”

    which is weird because I don’t recognize that file path….

    although when I click on “function.array-map” my photostream shows…. then lightbox sort of fails….

    Check it out here: http://rocketcity4x4.com/test/gallery/pics

    Any thoughts? I’m getting kinda frustrated…although your plug-in looks to be the best option for this client right now….

    THANKS IN ADVANCE!

    A

    • Posted April 7, 2010 at 11:18 am | Permalink

      Hi Aaron,

      Interesting, what WordPress version are you using? Also, what’s the shortcode that you’re using? It looks like it’s not getting any option arguments.

      • Posted April 7, 2010 at 6:25 pm | Permalink

        I’m using 2.9.2…..

        and the shortcode I used is [flickrpress]

        I sort of guessed at the shortcode…

        Any ideas? and again, thank you so much for helping!

        A

        • Posted April 8, 2010 at 10:20 am | Permalink

          Ah, that’d do it – please see the documentation on this page for info on how to use the shortcode: You need to give it some parameters.

          • Posted April 8, 2010 at 5:35 pm | Permalink

            I changed the short code to [flickrpress type=”sets” api_key=”c4e09e3bfb28434abf717c4e4f3294d6″ account=”RocketCity4x4″ view=”squares” count=”10″ lightbox=”true”]

            now I get the “flickr” is unavailable message….

            is there a surefire piece of shortcode that is currently working smoothly?

            Thanks Michael!

            a