Adding Facebook Like Button To Blog Posts (For Blogger)
Rabu, 14 Desember 2011
0
komentar
You can add a like button for your fan page or a like button for each and every blog post. There’s an old post I made on adding facebook like button to blog posts but this one explains it even further.
ADDING LIKE BUTTON TO EACH BLOG POST
This makes it a lot easier for your readers to share your blog posts with just a click. To add facebook like button to every blog posts automatically, follow the steps below:
1. Login to your blogger account and select Design
2. Click on Edit HTML
3. Check the box labelled Expand Widget Template
4. Like I always emphasize, back up your template before making changes in case something goes wrong
5. Press CTRL + F and search for <data:post.body/>
If you’re using a magazine style template or used the automatic read more hack I posted, you might find two or more <data:post.body/> in your template. You should try both to know which one works. The second works on my template though.
6. If you prefer to have the facebook like button to appear on top of your blog post right below the title, paste this code above <data:post.body/>
<b:if cond='data:blog.pageType == "item"'><div><iframe allowTransparency='true' expr:src='"http://www.facebook.com/plugins/like.php?href=" + data:post.url + "&layout=standard&show_faces=false&width=100&action=like&font=arial&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:400px; height:27px;'/></div></b:if> <br/>
7. If you prefer to see the like button below your blog posts, paste this code below <data:post.body>
8. You might as well put it in both positions. Save your template and view the change on your blog.
Note:
You can change the layout written in red which is set to standard by default to button_count if you want the like button to show number of likes instead.
You can as well set show_faces which is false by default to true. This enables the like button to show photos underneath but it applies to the standard button only.
The code above too only shows the like button on post pages. It won’t appear on static pages like label search results and home page. To make the like button appear on static pages involves removing two lines of codes: <b:if cond=’data:blog.pageType == "item"’> and </b:if>.
With those removed, the facebook like button appears on static pages and on blog post pages as well.
0 komentar:
Posting Komentar