Adding a Facebook Like Button

Adding Like Buttons to Your Blog

Adding Like Buttons

For those of us that blog, something to help bring more readers is a bit of the Holy Grail. Today Hamlet posted an article on New World Notes about the Facebook LIKE button we see on his site that brings in more readers. Checking it out, I found the links leading to the rather geeky version of the button. So, if you are a casual or super geek, here is how to get the button working… not that you need my help if you’re a supper geek…

There are 3 basic ways to install a new function in a blog; add a widget by uploading the thing, add a widget via the Plugins Panel, or add some code to the blogs programming.

First, the button is available in widget form. For most of us that makes it much easier to install in our blogs. You can get the widget for download and then upload into your site here: Facebook Like Button.

Second, you can open your admin panel and go to Plugins. Click Add New and enter Facebook Like Button. Look through the resulting list for the one made by Ahmed Hussein. In Chrome press Ctrl-F and type the name into the Chrome FIND dialog.

Ahmed’s plugin is not necessarily the best. I think it is the most like the one Hamlet links to. You may want to experiment with others. Let me know if you use or know of or find a better one.

My theme is one I made. Having only made a few themes I’m still learning. So, when Ahmed’s plugin broke my theme, which probably isn’t his fault, I figure I still have more things to fix in my theme. There is a CCS style included with the plugin. So, I could probably have fixed the problem.

Third, is to follow the link Hamlet provides in his article (Put a Facebook “Like” Widget on Your Second Life Blog Posts!), get the Facebook Developer code, and add the code to your site. You need to be logged into Facebook account before attempting to get the code. If you work with web sites, it is an easy addition. If you are not familiar with your blog’s coding then the challenge is: knowing where to add the code.

I use WordPress. To add the code to each individual post, open the file:

[blog_root_folder]\ wp-content\themes\[your_theme_name]\single.php

Look in the file for the code:

<div class="the_content">
   <?php the_content(); ?>

Then add the code from Facebook so the code looks like:

<?php the_content(); ?>
   <script src="[your_code]=1"></script>
   <fb:like href="http://[your_domain]" show_faces="true" width="450"
   <br /><br />

I split the <fb:like tag for appearance sake.

The code can be added in many places. Also one can use the XFBML or JavaScript. I show using the JavaScript. I would have had to sign up for stuff if I used the XFBML, so I didn’t.

Also, I’m not using any of the Facebook Like Buttons discussed. I’ve tried those. They work, but my curiosity kicked in and I went looking for better ones. I’m experimenting with different widgets for now. So, you may see the ‘LIKE’ buttons changing.

That is about it. I might get around to CSS formatting later.

Leave a Reply

Your email address will not be published. Required fields are marked *