|登录 |注册

查看: 1424|回复: 1
打印 上一主题 下一主题

Dynamic Facebook Like Button for Blogger

 关闭 [复制链接]
miniram
2012-2-6 08:49 PM
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:
  1. <div style='float:left'>
  2. <b:if cond='data:post.isFirstPost'>
  3. <script>(function(d){
  4.  var js, id = 'facebook-jssdk';
  5.  if (d.getElementById(id)) {return;}
  6.  js = d.createElement('script'); js.id = id; js.async = true;
  7.  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  8.  d.getElementsByTagName('head')[0].appendChild(js);
  9. }(document));</script>
  10. </b:if>
  11. <fb:like expr:href="data:post.url" layout='standard' send='true' show_faces='false' font="arial" action="like" colorscheme="light"></fb:like>
  12. </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
  1. xmlns:fb="https://www.facebook.com/2008/fbml"
复制代码
right after
  1. <html
复制代码
.
It will look like this:
  1. <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 人评分 论坛通知 收起 理由
叛逆志文 + 1 这里是中文论坛,如果要分享请翻译成华语或 ...

总评分:  论坛通知 + 1   查看全部评分

miniram
2012-2-8 04:16 PM
回复 1# miniram

bump
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2025-3-10 09:33 PM , Processed in 0.102991 second(s), 27 queries .

Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.

本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved

Dedicated Server powered by iCore Technology Sdn. Bhd.

合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部