Adding Facebook Like button, easy and hard way

Pretty sure you guys have seen the cool Facebook Like button appearing in some WordPress blog posts and you would love to add such feature to yours too. No worries, I will show you the easy way and the hard way of achieving this.

Easy Way
Through plugin of course! There are a few plugins that makes your task easy and my personal favorite is WP FB Like because of its simplicity. The settings are straight to the point, no mucking about. Activate it and select the position to show and voila! Instant Facebook Like feature on your site, easy peasy.

Hard Way
Now you may have noticed my Facebook Like button is found just below the post title above this page. To do this you will have to edit your site’s theme file called single.php, you can use notepad or the Editor tool in your WP control panel. Now pay close attention as themes’ single.php file will vary from one to another.

Look for

<?php edit_post_link

and add the below snippet directly below it

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

That’s all to it, enjoy :)

Photo credit via Mashable

Tags: , , ,

Subscribe

Subscribe to our e-mail newsletter to receive updates.

No comments yet.

Leave a Reply