Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A fully customisable HTML and CSS Tweet Button for Wordpress. Built using PHP; no JavaScript requirement. Uses the and Twitter APIs.
branch: master
Failed to load latest commit information.
example.html Change count to be a link to Twitter Search. Update CSS accordingly, …
styles.css Change count to be a link to Twitter Search. Update CSS accordingly, …

Custom tweet button for WordPress

Verified working with WordPress 3.0.1+.


  • account and API key
  • WordPress 3.0.1+

For more info:


Step 1: Download the Custom Tweet Button for WordPress files from Github.

Step 2: Login to your account and get your API key from the "settings" page. Replace the username and API key placeholders in the tweet_button function with your own.

Step 3: Include the custom-tweet-button.php file in your theme's functions.php file.

Step 4: Add the custom Tweet Button CSS to your theme's style.css file and the include the tweet.png image in your theme's image folder. Customise the CSS as you desire and make sure the image is correctly referenced.

Step 5: Call the function tweet_button in your template files (e.g. single.php) at the position(s) in the HTML you'd like the Tweet Button to appear:

if (function_exists('tweet_button')) {


0.3 [2011/04/07]

  • Update sprite to use new Twitter bird
  • Count is now a link to a Twitter Search for the URL
  • Display counts between 1000 and 9999 with comma separating the thousands
  • Display counts 10000 and over in 10.0K format
  • More generic Twitter button title and text

0.2 [2010/10/24]

  • Periodic cache refresh.
  • Checks that the Twitter API count data is for the URL that was requested.
  • Control over when the count is displayed with the tweet button

0.1 [2010/09/18]

  • First version.
Something went wrong with that request. Please try again.