Voxeo
  • For Businesses
  • For Developers
  • Products
  • Resources
  • About Voxeo
  • Contact Us
  • Chat
  • Email
  • Phone

      Give us a call

    • USA: +1 (407) 965 1112
    • Germany: +49 2203 1857-0
    • Europe/UK: +44 (0) 1707 290 433
    • Asia: +86 (10) 82825011
  • For Businesses
  • For Developers
  • Products
  • Resources
  • About Voxeo
  • Contact Us
  • Contact Us by
  • Chat
  • Email
  • Phone

      Give us a call

    • USA: +1 (407) 965 1112
    • Germany: +49 2203 1857-0
    • Europe/UK: +44 (0) 1707 290 433
    • Asia: +86 (10) 82825011
  • Log In
  • For Businesses
    • Solutions
    • View by Industry
    • Try Voxeo Now
      • Home
      • About
      • Plugin: Embed Allower 2

      We simplify
      tough business
      challenges.

      • Home
      • About
      • Plugin: Embed Allower 2

      Solutions tailored to
      your unique business
      needs.

    • Get started fast
      and easy with no
      strings attached.

      Try it free
  • For Developers
    • Try Voxeo right now - no hassles, no cost, no worries.
    • Click to get started.
    • Home
    • About
    • Plugin: Embed Allower 2

    Look no further.

    Voxeo has the platforms and tools
    you've been searching for.

  • Products
    • Try Voxeo right now - no hassles, no cost, no worries.
    • Click to get started.
    • Home
    • About
    • Plugin: Embed Allower 2

    Put the latest standards
    and technologies
    to work for you.

  • Resources
    • Need some answers? Check the glossary!
    • Choose a topic...
    • Home
    • About
    • Plugin: Embed Allower 2

    A plethora of resources!
    Explore. Learn. Share.

    Whitepapers, articles and product collateral.

  • About Voxeo
    • Come work at Voxeo!
    • Want to chat? Contact Us
    • Home
    • About
    • Plugin: Embed Allower 2

    What we're passionate about
    and why we're different.

    Read to learn more about Voxeo.

VOXEO BLOG / NEWS / EVENTS

Covering trends in customer experience, groundbreaking technology applications from our customers and partners, and technology trends - as well as whatever else is on our team’s minds.

How To Add Twitter’s “Official” Tweet Button to WordPress MU

August 13 2010 by Dan York
UPDATE Aug 13 – I had to disable the plugin after Firefox on Mac users indicated that they received multiple popup windows like this when browsing our site: twitterbuttonerror.jpg

I don’t know yet whether this is an issue with our WordPress theme, with the Twitter Button plugin or with the service from Twitter itself. Stay tuned…


With Twitter releasing their new “Tweet Button” yesterday, I was naturally interested in figuring out how to add the button to this site. Mashable had the first post out that I saw explaining the easy steps: “HOW TO: Use Tweet Buttons as a Blogger or Site Owner“. In going to Twitter’s “Tweet Button” page, it’s a fairly straightforward process to get the code you need.


THE PLUGIN

However, I want to make system admin of this blog server as painless as possible so before I added the code to our theme I looked around for a plugin. I was delighted to see in the comments to the Mashable post that a gent named Alex Cristache had already coded up a “Twitter Button Plugin for WordPress” plugin.

I downloaded and installed it into the wp-contents/plugins and activated it for one of our blogs. (More on site-wide activation in a minute.) It has a very easy to use admin screen that appeared from a link at the bottom of my admin navbar. (Note: I’m still running WPMU 2.9.2 here, so with 3.0.x it may appear differently.) The panel lets me make various config choices. I left it all at the defaults except for three areas:

twitterbuttonsettings2.jpg

  1. I needed to change the Twitter user name to ours.
  2. I changed the recommended user (Alex, the plugin author :-) ) to be one of our other Twitter accounts. This will apparently appear in the window from Twitter after you share the link,although it’s not doing so for me right now. (probably a load issue at Twitter):
    twitterbuttonrecommendations.jpg
  3. I changed the “margin-top” attribute in the CSS so that the Tweet button appeared in line with the top of the article text. This is a personal preference thing… and I like it this way.

With that, the tweet button was up and running on one of the blogs. I went on to test with another and all worked fine.


SITE-WIDE ACTIVATION

We support about a dozen active blogs on blogs.voxeo.com and I really didn’t want to have to go to each one to change around these defaults…. so I started hacking the code before doing the “Activate Site Wide” link.

Diving into wp-content/plugins/wp-twitter-button, I opened twitter-button.php and changed these lines:

function tb_activate() {
        $default_settings = Array(
                'tb_home' => 1,
                'tb_archive' => 1,
                'tb_feed' => 1,
                'tb_page' => 1,
                'tb_box' => 'vertical', // can be none, horizontal or vertical
                'tb_style' => 'float: left; margin-right: 10px; margin-top: 20px;',
                'tb_position' => 'before', // can be before or after
                'tb_via' => 'Twitter',
                'tb_recommended_id' => 'Blogsessive',
                'tb_recommended_description' => 'Blogging, Social Media and ...'
        );

 

to these lines (changes in red):

 

function tb_activate() {
        $default_settings = Array(
                'tb_home' => 1,
                'tb_archive' => 1,
                'tb_feed' => 1,
                'tb_page' => 1,
                'tb_box' => 'vertical', // can be none, horizontal or vertical
                'tb_style' => 'float: left; margin-right: 10px; margin-top: 0px;',
                'tb_position' => 'before', // can be before or after
                'tb_via' => 'voxeo',
                'tb_recommended_id' => 'tropo',
                'tb_recommended_description' => 'Tropo is a powerful yet simple API ...'
        );

(Note that I have not included the entire “recommended description” in this code example purely for space/layout reasons with this blog post. In the file I have the full descriptions.)

I then went ahead and clicked the “Activate Twitter Button for WordPress Site Wide” link on my Plugins panel and it worked fine.


THE END RESULT

I now have the official “Tweet” button working on my WPMU 2.9.2 install and it seems to be working fine. The issues I see so far:

1. TWEET COUNT IS OFF – It seems the big issue everyone has right now is that the count of the number of tweets is off a bit. Commenters to the Mashable post and to the WordPress plugin page both indicate this is a problem. The plugin author stated this:

That ZERO tweets “bug” is actually caused by Twitter’s method to calculate tweets. They calculate them based on the number of search results on Twitter for the shared URL, and since their search history doesn’t go that far behind, some of the posts will display 0. The API they have provided is still far from perfect, but I think they said the button is hosted on a different server which might mean that from now on, all counts will not depend on the search anymore so new posts should be fine.

 

2. WISH THE NUMBER WOULD NOT SHOW IF “0″ – Given that count issue, I wish there was the option to NOT display the count if the number of tweets is zero. It’s just a perception thing… I’d like to not show that a particular article hasn’t had an Twitter-love yet (particularly if it did have tweets and now doesn’t have a count as an artifact of Twitter’s problems) I intend to make the suggestion back to the plugin author… but this may be a Twitter issue.

 

3. DO RECOMMENDATIONS WORK? WHAT IF I ONLY WANT ONE? – So far when I’ve tweeted out a blog post using the button, I’ve not yet seen the “recommendations” screen that Twitter says we’ll see. Is Twitter not displaying it right now? Does it work? What if I don’t want to recommend a second account- do I just leave that field blank in the plugin panel?

Obviously before I can answer any of that I have to see recommendations. :-)

 

Overall, though, it seems to be working great. Kudos to Alex Cristache for coming out with this plugin so quickly. It’s a great help and saved me from hacking away on my theme.

Anyone else found another way (or plugin) to do this? What have you found so far?


Related posts:

  1. What the ___?? NO, Twitter, I did NOT recommend those users! TWEET BUTTON FAIL!
  2. WordTwit – a great way to tweet posts from WordPress MU
  3. Connecting WordPress MU to Twitter to auto-tweet new blog posts
  4. What is the best Twitter plugin for WordPress MU?

About Dan York

Director of Conversations at Voxeo View all posts by Dan York →
This entry was posted in Plugins, Twitter, WordPress MU and tagged Plugins, Twitter, wordpressmu. Bookmark the permalink.

Join the Conversation

    • LinkedIn
    • Facebook
    • Twitter
    • YouTube
    • Home
    • About
    • Plugin: Embed Allower 2

Join the Conversation

  • For Businesses
  • For Developers
  • Products
  • Resources
  • About Voxeo
  • Contact Us
  • Copyright 2013 Voxeo
  • Newsletter
  • Sitemap
  • Privacy Policy
  • Developer Portal
  • Try-Voxeo

Want to chat? Click here.

x

Ready to talk to someone right this second? We're live, ready to help in
any way we can.

Let's go!
x

You look nice,
let's keep in touch.

Oops! We could not locate your form.