Add Facebook “Like” Buttons To WordPress Blog Without Using Plugins
WordPress Facebook like button or the Facebook share button on your WordPress blog will definitely improve your website or blog’s popularity. Facebook is the leading Social Network service with millions of people are active members. Thousands are joining every day. If you are a blog or website owner, then you can make use of the Facebook to make your blog more popular.
Facebook “Like” button is one of the best shortcut to make your blog post or article popular. If one person likes one post it will be displayed in his profile page. If that person has many friends in his network, most of them will see the Post and this may yield more traffic to your blog from Facebook.
It is always a better idea to provide a mechanism to your users to share your post. Be it Facebook Like or Twitter Tweet or Digg or any other. The more people share your article the more popular your blog becomes. Even search engine gives extra considerations to posts or articles which are popular in social network sites.
Today we will see how to add Facebook “Like” button to your wordpress post or any other pages without using any plugins. In fact the less the number of plugins you use the more faster it becomes.
Add Facebook “like” Button scripts to your blog post .
In wordpress the file which will be rendered as the post page is the ‘single.php” file. This you can see in the themes folder. Once you identified the file, you can add the code given below to the location where you want the Facebook “Like” button to appear. Find the code similar to the below code. If you want to add the facebook “Like” button below the title you can add similar to the below code.
1 2 3 4 | <?php if (have_posts()) : while (have_posts()) : the_post(); ?> ................................................................................... <?php the_title(); ?> YOUR FACEBOOK LIKE SCRIPT CODE HERE |
If you want to add the “Like” button below the post content you can find code similar to the below and add the script.
1 2 3 4 | <?php if (have_posts()) : while (have_posts()) : the_post(); ?> ................................................................................... <?php the_content(); ?> YOUR FACEBOOK LIKE SCRIPT CODE HERE |
Identify the appropriate location inside the loop, like after post header or at the end of the content etc.
There are two Facebook Like button implementations: XFBML and Iframe. The XFBML version is more feature rich but require the JavaScript SDK.
You can choose from three different layout styles.
- standard
1 2 | <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px;"> </iframe> |
- button_count
1 2 | <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=button_count&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px;"> </iframe> |
- box_count
1 2 | <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=box_count&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px;"> </iframe> |
- The XFBML verson
1 2 | <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<?php echo get_permalink(); ?>" show_faces="true" width="450"></fb:like> |
Here the XFBML version URL defaults to the current page.
Apart from the above layout styles you can also select the width of the like button, color scheme etc. You can read more detailed tutorial in Facebook Like Button reference page.
Sign up or join Globinch on Social Media
Stay Connected
Follow globinch
Popular Posts
- Search Engines for File Sharing Sites : Rapidshare Search, Megaupload and More 6 comment(s) | 16258 view(s)
- Turn your Windows 7 Computer Into a Personal Wi-Fi Hotspot 15 comment(s) | 16117 view(s)
- Google Translate Now supports Bengali, Gujarati, Kannada, Tamil and Telugu 2 comment(s) | 15714 view(s)
- Google Top Searches Today – Hot Google Search Words today 12 comment(s) | 11559 view(s)
- Best PDF OCR Tools to Convert Scanned images to Text / Word Documents 20 comment(s) | 10154 view(s)
- Globinch Search 0 comment(s) | 8402 view(s)
- Access Blocked sites, Unblock Restricted Websites 15 comment(s) | 7312 view(s)
- Free Online OCR Software to Convert Images Into Searchable PDF, Doc, HTML or Text 3 comment(s) | 7238 view(s)
- Password Revealer – How To Reveal- Show Password Behind Asterisks? 7 comment(s) | 7180 view(s)
- Play Angry Birds Game Free and Offline in Chrome Browser 1 comment(s) | 7049 view(s)
Recent Articles
- Best Free Tools to Enlarge Images without Losing Quality
- How to Track Your Gmail Email and Schedule Gmail Mail Free?
- Google Webmaster Unnatural Links Detected Warning & Penalty
- How to Use Trial Software Version Forever Without Expire
- How to Use Folder as Drive or Convert Folder to Drive?
- Add Buttons, Message Boxes and Text Highlights in WordPress Post
- Top 20 Free WordPress Social Share Plugins
- rel=”shortlink” Short URL Indicator and Its WordPress Support
- Pagination SEO Using rel=”next” and rel=”prev” Link Attributes
- Watch Live IPL 2012 Season 5 Online on Your Computer or Mobile










Pingback: How To Add Twitter Retweet Button To Blog Without Using Plugins | Globinch
Pingback: Google +1 Button Lets Visitors Share Pages With Circles on Google+ | Globinch
Pingback: Google Plus Live Feeds Widget To Get More Followers | Globinch