view my SEO resume
Best Las Vegas SEO Expert & Marketing Director

Twitter’s New Tweet Button is TWEETACULAR: A How To Guide!

How to Customize the Twitter Tweet Button for WordPress Blogs

Twitter recently came out with a button similar to Facebook’s “Like button” (move over Facebook).

The Tweet Button is “a small widget which allows users to easily share your website with their followers.” (Twitter dev page)

A user clicks on the Tweet Button and is prompted with a login to enter Twitter login info. If a user is new to Twitter, he/she can create an account, The Share box will appear with information on the item to be tweeted about. This usually will include a short subject, link to the article/site and the twitter account associated with the article or site.

The tweet is submitted and users are offered a chance to follow the twitter account of the person who owns the website or whom created the article.

Twitter is offering a number of ways to you can add the Tweet Button to your website. The most direct way is just copying and pasting some javascript code into your html:

<script src="" type="text/javascript"></script>
<a href="" class="twitter-share-button">Tweet</a>

You can also use an iframe or you can build your own.

Here’s an example for building the Twitter Tweet Button into your website, specifically your PHP based WordPress blog.

You’ll need to open up two php files:


Both of these files should be the php files in your template folder, not in the main WordPress folder.

You’ll have to locate the ideal place for your your Tweet Button. In the index.php page locate the <?php if ( have_posts() ) : ?>. Your code should be placed within the loop that follows. Here’s sample code:

&lt;a href="" class="twitter-share-button" 
data-url="&lt;?php the_permalink(); ?&gt;" data-via="steffanlv" data-text="&lt;?
php the_title(); ?&gt;" data-related="steffan haeberle: web design & seo consultant" 
data-count="horizontal"&gt;Tweet&lt;/a>&lt;script type="text/javascript" 

The code above contains the standard Tweet Button as well as five other variables to complete the Tweet Button functionality.

  • data-url=”<?php the_permalink(); ?>”
  • data-via=”steffanlv”
  • data-text=”<?php the_title(); ?>”
  • data-related=”steffan haeberle: web design & seo consultant”
  • data-count=”horizontal”

data-url=”<?php the_permalink(); ?>” – “the_permalink” will use the textual link to the article you will use.

data-via=”steffanlv” – “data-via” is the name of the Twitter account associated with the article or website.

data-text=”<?php the_title(); ?> – “data-text” is the textual title you want to use.

data-related=”steffan haeberle: web design & seo consultant” – “data-related” is the title of the Twitter account that the user will see when he/she is prompted to Follow the originator of the website or article.

data-count=”horizontal” – “Vertical” or “Horizontal” is the format the Tweet Button count will show, either above the button or beside it.

Here’s a screenshot layout for each variable:

tweet button wordpress

Feel free to copy and paste the code, change the variables to your like and integrate it into your own WordPress site. Got any questions or comments feel free to leave them below or contact Steffan.

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

My portfolio speaks for itself. With two INC 500 companies and the #1 rated nightclub in the world as clients, there are few that can rival the success in SEO I have had. Ask me about why I am considered one of the best las vegas seo experts, orlando seo and los angeles seo experts .
read more

Latest from Flickr


Steffan Haeberle
9493 Alma Ridge Ave
Las Vegas, NV 89178
Twitter: steffanlv
Facebook: steffan.haeberle
LinkedIn: steffanh

Latest Video

Steffan Haeberle, Las Vegas SEO Expert
5 stars - based on 95 reviews
9493 Alma Ridge Ave Las Vegas, NV 89178, 407-342-0631
Hours: Open 24 Hours