Add a Facebook “Like” button to your WordPress self-hosted blog

Now that Facebook is spreading out across websites all over the internet, you, too can join in on the connectivity by adding some code to your WordPress self-hosted website or blog.  With credit to Ruhani Rabin’s post, here’s how to do it:

(*make sure you have a backup copy of all your template files before you do this!)

1) Log into your WordPress backend.

2) Go to Appearance: Editor

3) Open single.php

4) Place this code right before <?php the_content(); ?>

<iframe src=”http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;colorscheme=light” scrolling=”no” frameborder=”0″ allowTransparency=”true” style=”border:none; overflow:hidden; width:450px; height:60px”></iframe>

5) Click “update”

6) refresh your blog page and see the new Facebook Like button at play!

And if you don’t want to delve into the code, use this super easy plugin by Todd Williams!

This entry was posted in Facebook, General How-To, Social Media Strategies, Wordpress and tagged , . Bookmark the permalink.

5 Responses to Add a Facebook “Like” button to your WordPress self-hosted blog

  1. CScholz says:

    http://developers.facebook.com/docs/guides/web

    The original source information from Facebook.

  2. CScholz says:

    http://developers.facebook.com/docs/guides/web

    The original source information from Facebook.

  3. Sonic Blink says:

    I wrote a plugin that makes this much easier and offers a live preview in the wordpress settings while you play with the different options. http://bit.ly/awqa5C

  4. PlF says:

    Here's the WordPress plugin:
    http://wordpress.org/extend/plugins/like
    No coding necessary, you can customize the look and placement of the button in the settings interface

  5. PlF says:

    Here's the WordPress plugin:
    http://wordpress.org/extend/plugins/like
    No coding necessary, you can customize the look and placement of the button in the settings interface

Leave a Reply

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

*


*

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