How to add FB Like to every post

How to add the Facebook “Like” button on every post in any theme.

It’s quite simple actually, I’ll guide you through the whole process after the jump…

Getting Started adding a FB Like button to all posts in your theme:

Open one of the template files for your theme where you would like the button to be. Let’s say we want a button after the title in every post, so we would need to edit single.php

Where ever you want the code to appear, just drop in the following line of code: (Remove all the line breaks, this is a one liner.)

<iframe src="<?php
scrolling="no" frameborder="0" allowTransparency="true" 
style="border:none; overflow:hidden; width:300px; height:30px">

Valid options for show_faces is true or false. True Shows faces and False doesn’t. Pretty simple.

Colorscheme is light, dark or evil. I choose evil, but I’m not sure what’s evil about it. Looks just the same as light does to me.

Obviously the width and height need to be adjusted to your theme and the placement in your theme to suit it best.

*In the code above, anything marked in this color is what you can change to customize it, or use the customization wizard located at: If you make your own using the wizard, don’t forget for the to add the Pink code after you generate your button, for the URL just put in and customize like you want. Then replace with<?php the_permalink() ?> for using in your wordpress theme.

1 Comment
  1. Jason June 9, 2010 at 5:06 pm

    Thanks Bruce for the mentioning it was overflowed.

Leave a reply

Skip to toolbar