The official Twitter plugin helps you to share your blog using twitter cards to make your links stand out from the card, gives you a follow button and the ability to customise your embedded tweets. Alongside all this, you get access to enhanced twitter analytics, so what are you waiting for?
3 steps to setting up the official twitter plugin on self hosted wordpress.
Install the plugin.
You’ve probably seen twitter cards attached to tweets before now – they’re the ones with summaries or images attached. They stand out from the stream, and give people an idea what they’re clicking through to. The first step to getting all this goodness on your site is installing the plugin. Go to Plugins >Add new and search for twitter. You’re looking for the official plugin. Once you’ve found it, hit install.
[Note, this plugin requires PHP 5.4 or higher. If you’re not sure whether you’ve got that, it’s a question for your hosting provider.]
Setup post formats.
This official plugin uses post formats to decide what card to share with a post. Post formats are theme reliant – if you’ve already got them active, you’re looking for a radio button probably over there on the right, with a list of possible formats as described here. (If you don’t have them visible, the first thing to do is check the screen options (top left) and make sure that you don’t just have the Format option switched off. See the image below for details.)
If Format isn’t in your screen options list though, that means your theme doesn’t support them. Don’t panic, there are still options. For example if you’re using a Genesis theme, you can grab the code snippets from studiopress here and add them to your child theme functions.php. (You’ve got a child theme, right?)
If you’re not on Genesis there’s an informative article here on how to add them to your theme.
Validating your chosen card types.
The other webpage you’re going to need to make friends with is the twitter card validator itself. For each card type you want to use, you need to validate a post with the right markup. This sounds a bit complicated, but it’s as simple as filling in the setup detail in the plugin (basically your twitter handle) and then either editing old posts to be the format you want (from photo and gallery) and submitting the link to the validator. A normal post comes through as a summary card.
For each card, a good picture is a great idea, although a gallery needs 4. Once you have the cards validated against your domain, any time anyone tweets from your site, a card will go along with the tweet, and you’ll get to see all of it in your enhanced analytics (under your twitter profile).
The twitter plugin also offers an enhanced twitter follow button, and tweet button, but to my mind, the cards are the real winner here. Let me know if you get them set up.