If you’re creating a design portfolio website in WordPress – why, yes, much like this one – you may well want to include a handful of shots from your Dribbble account in order to show off your skills.
Happily enough this is quite straightforward with a jQuery plugin called Jribbble created by Tyler Gaw. There’s a ton of options available for working with the Dribbble API, but here we’ll just concentrate on the simple task of pulling in a few recent shots from an account and displaying them on a template.
First you’ll need to register an application via your Dribbble account, and grab the secret token it’ll generate, which is a simple numeric string.
Next, we need to make the site actually pull in this file, of course doing it the WordPress way with a proper register and enqueue. If you only plan to output your shots on one page, you can go further and wrap the call to your script in a template conditional – I’m planning to just show my shots on the ‘About’ page, so I’m making sure to only load the script when that particular template is in use.
Now we’ve got the Jribbble script loaded, we just need to create an empty element to hold our shots, and invoke the plugin with the data we want back.
Remember to swap in your application secret token and set the username and number of shots you need. I’ve also wrapped a little Bootstrap markup around each shot for some quick and easy grid styling.