Posted on 28 April, 2010 By 19 Comments

2 Ways to Like Add Facebook Like to Your WordPress Site

 

Like Cola? (2) (by found_drama)

Facebook wants us to like things rather than fan or share them. I’m not, like, really liking, this change, like, you know? It makes me think of people who use like every three words they say and about passing notes in junior high. “Chris – do you think Billy likes me? Can you ask him? But don’t tell him I wanted to know.”

So, we can now add like buttons to our website. What’s cool about it is that it will show the little avatars of the people who liked your article and will post on their wall and newstream that they liked the article (if their settings allow for that).

There are two ways to add the like button in WordPress.

Code

The code method is the first way. I would add the following to the bottom of my post in the single post page. It’s usually single.php under Appearance > Editor

<iframe src="http://www.facebook.com/plugins/like.php?href=
<?php the_permalink(); ?>&layout=standard&show_faces=true
&width=450&action=like&colorscheme=light" scrolling="no"
frameborder="0" allowTransparency="true" style="border:none;
overflow:hidden; width:450px; height:px"></iframe>

You can change some of the variables such as the width, change scrolling to yet, add a border, etc. Note that the url being shared is

<?php the_permalink(); ?>

That is so it pulls the specific WordPress post that is being liked. Make sure that the code added is still within the loop on the single.php page. I would put it below

<?php the_excerpt(); ?>

or 

<?php the_content(); ?>

I have tried putting it at the top of the post but even when I set the height on the code, it pushes the beginning of the post down too far. It’s almost like (no pun intended) that it’s making room for the hoards of Facebook users who are going to be liking your post. If you’ve found workaround for this please let me know.

If you want to read more about this code or play with the fancy code generator it is available on the Facebook Developer’s Like Button Page.

Plugin

You can also install the WordPress plugin called Facebook Like Button. It basically does what the code above does but there was one thing I didn’t like about it. It adds the like code everywhere and not just to posts. I might want someone to like my Services page but it doesn’t make a lot of sense to have a like button on my contact page. It is, however, super easy to set up. Just be sure to select the iframe option in the plugin settings.

So there you have it – two ways to add the Facebook like button to your WordPress site. Hope you liked it.

Like This!

photo credit: found_drama


Emails for Small Business with Constant Contact

Keep Reading:
Posted In : Facebook | WordPress Tips

Did you enjoy this article? I can assist you with your WordPress or Facebook project. Contact me and I will provide you with an estimate. You can also connect with me on Facebook or follow me on Twitter. If you are looking for Hosting, WordPress Theme, Newsletter or other recommendations, please view my detailed list

.


19 Responses to “2 Ways to Like Add Facebook Like to Your WordPress Site”

Leave a Comment
You may use: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

CommentLuv badge

About

Kim Woodbridge is an accomplished Information and Technical Consultant specializing in the entire implementation of a WordPress based website including installation, theme design, upgrades, unique customizations and ongoing site maintenance.

Recent Comments

    • Eric Chapman: You rock; thank you!...
    • Victoria12: Wow! This are so cute. It is so much special when our kids do it on their own and give it us as a surprise gift.. So tou...
    • Catherine: I hope that the page owners have a plan for the transition. One concern is that Facebook doesn’t have a great method of ...
    • harm: You no longer can "Add to My Page" This used to be simple, using the facebook UI. Unfortunately facebook removed thi...
    • Phil Derksen: I was referencing plugin #1 in the list btw. :)...

Wordpress Services

  • Installation, upgrades and maintenance
  • Conversion of existing html and css templates
  • Theme and plugin recommendations
  • CSS customizations
  • Troubleshooting and tweaks for unique situations
  • Customization for individual blogging goals and needs
  • Training and advice