This plugin adds features to your blog that allow you to display anyone’s latest tweet anywhere in your theme or in place of your blog description (aka tagline).

Installation

  1. Download
  2. Unzip
  3. Upload to wp-content/plugins/
  4. Activate
  5. Insert the template tag somewhere into your theme
  6. Enjoy!

Features

  • Set a default Twitter username or specify one when inserting the template tag
  • Set a default tweet for when Twitter is down

Compatibility

Twitter tag was tested in Wordpress 2.3 but I don’t see any reasons why it shouldn’t work in earlier versions of Wordpress. If you encounter any bugs, please let me know by leaving a comment.

Licensing

Creative Commons License

This work is licensed under a Creative Commons License.

Usage

Twitter tag can be used in two ways:

  1. You can use it to display anyone’s latest tweet anywhere in your theme (requires you to edit your theme’s file)
  2. You can replace your blog’s description (also know as the ‘tagline’) with the latest tweet from a specified username
  3. You can also do both!

First let’s go over the first option, it’s the easiest. To do this, simply activate the plugin and go to it’s options page (it’s under ‘Options –> Twitter tag’ in your blog’s admin section). There you’ll find there are two field to fill out, and checkbox. To use Twitter tag in the most simple way, tick the checkbox. No fill in the username you would like to display tweets from (usually your own) and fill in a default message for Twitter tag to display when Twitter is having problems. Now click update options and you’re all done!

Now for the second way of using Twitter tag. First activate the plugin and go to it’s options page. Specify a default username and a default message. Now you can go into your themes files and add the twitter tag. Let’s go over the basic ways of using it:

1
<?php twitter_tag(); ?>

This will simply display the latest tweet of the default username specified in the options page.

1
<?php twitter_tag('differentusername'); ?>

You can also specify a username when inserting the tag. This way you could make a page where the latest tweets of all your friends are displayed.

1
2
3
4
5
<?php
  if ( !twitter_tag('username', FALSE) ) {
    echo "Twitter is down or the username is incorrent";
  }
?>

You probably won’t need this, but the option is still there. When using FALSE as a second parameter twitter_tag() echoes nothing, it only returns TRUE or FALSE. FALSE means that Twitter didn’t send any valid data or the username is incorrect.

Ofcourse you can also use twitter_tag() inside your themes’ files while also using it to replace you blog description with the latest tweet from the default username.

4 comment op “Twitter tag”

Leave a comment