Home / Language / English / Add Facebook LIKE button to WordPress Posts

Add Facebook LIKE button to WordPress Posts

Facebook introduced more social interactions with their new “Like” or “Recommend” Button. This Facebook button enables the user to interact with a site or page. Additionally share it with his/her friends at their own Facebook profile.

Reference: Link

Enter the following code in the WordPress Post Loop where you want it to appear.

<!– start of fb like 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:60px”></iframe>
<!– end of fb like code –>


If you like to show the faces of your friends, change the part “show_faces=false” to “show_faces=true

If you like to show the label of the button as “Recommend“, change the part of the code “action=like” to “action=recommend

About Mohammad Khazab

Interested in this?

Diigo : Collect and Highlight, then Remember

Highlight and Add sticky notes on webpages Instead of just bookmarking, Diigo allows you to ...