how to add facebook like button to wordpress site

how to add facebook like button to wordpress site

Facebook Like button released on Apr. 21st 2010. Facebook’s social plugins were integrated into more than millions of  websites. wordpress tutorial for, how to add facebook like button to wordpress site.

This number will increase by the time.

how to add facebook like button to wordpress site

If you want to add the facebook like button in your wordpress website, I recommend not to use any plugin because that will be very easy without adding any plugin.

how to add facebook like button to wordpress site
how to add facebook like button to wordpress site

Just open your theme folder and in that you will find the single.php and index.php file. Open that files and put following code in that file.

Before following title line you can put the code. Like as follows:

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<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:30px"></iframe>

Following are the custom setting for changing the facebook like UI. You change that as per your requirement.
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”

I hope this will help you to implement the “Like” button on your WordPress Posts! Have fun and drop me a line at twitter or you can click on the “Like” button on the top of this post

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.