- 分享
- 0
- 人气
- 0
- 主题
- 16
- 帖子
- 49
- UID
- 428328
- 积分
- 33
- 阅读权限
- 11
- 注册时间
- 2011-6-30
- 最后登录
- 2015-2-9
- 在线时间
- 675 小时
|
How to add Facebook like button on your blog post:
1. Use the configurator to customize your favorite Facebook like button. Go here to configure your code.
Default Code:- <div style='float:left'>
- <b:if cond='data:post.isFirstPost'>
- <script>(function(d){
- var js, id = 'facebook-jssdk';
- if (d.getElementById(id)) {return;}
- js = d.createElement('script'); js.id = id; js.async = true;
- js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
- d.getElementsByTagName('head')[0].appendChild(js);
- }(document));</script>
- </b:if>
- <fb:like expr:href="data:post.url" layout='standard' send='true' show_faces='false' font="arial" action="like" colorscheme="light"></fb:like>
- </div>
复制代码 2. Copy the code above. Login to your Blogger Account and go to Design > Edit HTML and click on the check box which says “Expand Widget Templates”.
3. Look for <data:post.body/> and place the copied code below or above of it.
*Above - if you want the Facebook like button appear before the post.
*Below - if you want the Facebook like button appear after the post.
4.Next you have to add the fb namespace to your template tag.Your template should have the specification for the fb tag that you have used. The following namespace declaration will take care of that. To declare the namespace, find <html on the top of the template code.
5. Place- xmlns:fb="https://www.facebook.com/2008/fbml"
复制代码 right after.
It will look like this:- <html xmlns:fb="https://www.facebook.com/2008/fbml"
复制代码 6. Now Save the template and you should see the Like Button near each of your posts. You are done ^^ |
-
总评分: 论坛通知 + 1
查看全部评分
|