Skip to content

Instantly share code, notes, and snippets.

@Pleiades
Created November 15, 2012 20:14
Show Gist options
  • Save Pleiades/4080970 to your computer and use it in GitHub Desktop.
Save Pleiades/4080970 to your computer and use it in GitHub Desktop.
Add a Flickr Badge
[flickrbadge count="4" layout="h" display="latest" size="t" source="all_tag" tag="fish"]Here’s the latest fish[/flickrbadge]  
function flickr_badge_shortcode($atts, $content=NULL) {
$query_atts = shortcode_atts(array('count' => '6', 'display' => 'latest', 'source' => 'user', 'size' => 't', 'user' => '', 'layout' => 'x', 'tag' => '', 'group' => '', 'set' => ''), $atts);
return sprintf('<div class="flickr_badge"><h3>%s</h3>%MINIFYHTML4aa6a36d65c23758386d54e4aa7cef3c10%</div>', $content, http_build_query($query_atts));
}
add_shortcode('flickrbadge', 'flickr_badge_shortcode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment