Skip to main content

How to add Facebook Like button in WordPress theme and Blogger Blogs

INSTALLING FACEBOOK LIKE BUTTON

Facebook is the fastest growing social networking website. A presense of your website in face book give a good impression to the viewers. If you have lots of followers in facebook, then that shows your site popularity.

Facebook provides "Like Box" service, so that users can link their website to facebook and promote the website contents, Using "Share" and "Like" options contents can be shared across various communities and friend groups in facebook. Once a user "Likes" your website post, immediately the people in the friend groups of th eperson who "liked" your post will get an intimation.
So there is a  chance that several people may look into the "Liked" site and it may  driver visitors to your website.

Adding Like Button to Wordpress Themes

It is very easy to install the facebook like button on your wordpress theme.

Simply do the following:

find the file "single.php" and add the following code in that


<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&amp;layout=standard&amp;show-faces=true&amp;width=530&amp;height=60&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:530px; height:60px"></iframe>




Adding Like Button to Blogger Blog Templates

Login to your blogs admin area and go to Design option in blogs dashboard. Click on edit HTML and select expand widget option. In the HTML contents find the following section:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
..................
.................
....</b:if>


in that section add the following code:

<iframe expr:src='"http://www.facebook.com/plugins/like.php?href=" + data:post.url + "&amp;layout=standard&amp;show-faces=true&amp;width=530&amp;height=60&amp;action=like&amp;colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:530px; height:60px' allowTransparency='true'></iframe>

and Save your template.

-- -- -- -- -- -- -- -- --

The above codes for blogger and wordpress are in general format, you can customize it according to your needs. You can change the layout , height , width etc..

If you want to show only the Like count in the button then change layout=standard to layout=button_count. if you want to hide the faces of the people who like your post then change show-faces=true to show-faces=False.

You can also change the color scheme to dark by changing colorscheme=light to colorscheme=dark and other small changes regarding the height and width of the button.

If you are not familiar with how to create a facebook fans page and facebook like box for your website, then read this article :

How to create facebook fans page?

How to create Facebook Like Box Widget?

Comments

Popular posts from this blog

Strange problem occured while trying to create a CSV file using PHP Script - The file is not seen on FTP but can download using file's absolute path url

Strange problem occured while trying to create a CSV file - The file is not seen on FTP but can download using file's absolute path url Last day I came across a strange problem when I tried to create a csv file on therver using a PHP script. the script was simply writing a given content as a csv file. The file will be created runtime. What happened was, The script executed fine, file handler for new file was created and contents was wrote into the file using fwrite and it returned the number of bytes that was written.

How to get the Query string of a URL using the Javascript (JS)?

JS function get the Query string of a URL or value of each parameter using the Javascript(JS)? If you want to get your current page's url var my_url=document.location; to get the query string part of the url use like this: var my_qry_str= location.search; this will return the part of the url starting from "?" following by query string Lets assume that your current page url is http://www.crozoom.com/2013/page.html?qry1=A&qry2=B then the location.search function will return " ?qry1=A&qry2=B " to exclue "?", do like this:


Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog