Earlier this week I wrote about how you can add a shortcode to the functions.php to make it easier to use Creative Commons images on your blog, while always remembering to put in the correct attribution.
Adding this to your theme has some drawbacks. The most important one is that you’ll have to do it all over when you change the theme, another is that you have to add the flickr api key directly into the code.
That’s why I have just made it into a wordpress plugin. This means you just need to download the package, extract it into the plugins folder, and then use the “El Flickr” menu entry to add the flickr api key.
I have changed the flickr shortcode to elflickr, so there should be less possibility for conflict with other plugins. You chan also change the shortcode to whatever you want (including flickr) from the configuration page.
I’ve also added another feature. Lets say you need a HDR picture of Bergen, but don’t care too much which one is used, what if you could add the picture without going to flickr to look it up? The question is of course rhetorical, because now you can.
[elflickr search="HDR Bergen from Fløien"]
yields the picture in the beginning of this article. The result of the search is stored, so you don’t need to worry that the search results will change over time. It also limits the search to Creative Commons licensed pictures.
[elflickr search="Tilt shift bergen city"]
I have a lot of ideas for this plugin, the release is numbered 0.0.2, and there’s a lot of room for improvements. For instance I will incorporate the gallery into the plugin, which currently is implemented in my theme.
If your blog is hosted on my server, I will install it for you if you ask me to.
The plugin just generates the HTML code, you need to style it using your stylesheet, see the flickr shortcode for an example, and for more examples on how to use the plugin.
- styling from configuration page
- configuration of licenses to search for
- more caching of rest call results
- integrate the gallery into the plugin
- provide a default theme
- search by geolocation