Facebook and Twitter Buttons Without Plugins

Easily add Facebook and Twitter counters without using plugins

Facebook and Twitter buttons are all the rage lately, providing an easy way for your readers to quickly share your posts on the social media sites with nothing more than a click, as well as seeing who else has done the same. Take note that these counters are different from the Facebook Like Button.

Fortunately, adding these buttons is very simple and requires little technical skill.

Using ShareThis to do the leg work

To add the Facebook counter to your website, all you need to do is add a little code to two of your theme files (header.php and single.php). To get the specific code for your website, head over to ShareThis and follow these instructions:

  1. Select “Any website”
  2. Choose “Horizontal Counters” (or other if you would prefer)
  3. Select the style on the left (not the ShareThis button)
  4. Hit “Get The Code Already”
  5. You’ll now be prompted to register an account – it’s quick, easy and spam-free.
  6. The next page will give you two lots of code: the top piece of code needs to be inserted in single.php, wherever you want the button to appear (probably before or after the content). However, if you don’t want their email and share buttons, just remove the following from the end of the code provided:

The second piece of code needs to inserted in your header.php file – just before the tag will do perfectly.

It’s as simple as that. Now refresh one of your posts and check that it’s working properly.

6 thoughts on “Facebook and Twitter Buttons Without Plugins”

  1. Thanks for the post/tutorial. Now i don’t need to use any plugins. However i like the plugin i am currently using as it does everything for me and its automatic. :)

    1. Dave says:

      So what plugin are you using to achieve the same functionality? I tried looking around and I couldn’t really find anything that did the same thing…

  2. hey i just went through your recent email with how to’s it was great, however having one question, I always did have a hard time with RSS feeds. I have social buttons and have nothing in my site bar like you to subscribe to a RSS feed for my site…help if you can or suggestions? thanks

    1. Dave says:

      Hi there,

      I was just having a look over at your site and I’m not sure which part of my site you’re referring to, but I do see an RSS icon above your navigation bar (kind of peeking out of it), in your sidebar and at the bottom of every post. In short, you want to provide ample opportunity for readers to sign up to your RSS feed. On my site for instance, there’s a link in the header, the sidebar and by auto-discovery (if supported by the viewer’s browser).

      I think you’ve got plenty of opportunities for people to sign up to your RSS feed, unless I’m misunderstanding your question. Let me know if you have any more questions, or want help integrating a new approach.

      And thanks for the kind words about Do More With WordPress. Much appreciated!

  3. Elling says:

    Thanks! I had been looking all over trying to figure out a nice way to add Twitter and Facebook chicklet counters to each post and it was driving me up the wall. Now it seems so simple.

    1. Hey you’re most welcome. Hope you got everything installed easily enough

Leave a Reply