Add a Facebook “Like” button to your WordPress blog

Open your single.php (or any file where you’d like the “Like” button to be displayed), and paste the following code:

<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:25px"></iframe>

That’s all. Once the file saved, the facebook “Like” button will be displayed. A live demo can be seen on Visiter New York.

Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!

Add a Facebook “Like” button to your WordPress blog

Leave a Reply

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