MenuBar

Friday, January 15, 2016

TutorialBlog: Insert Facebook Comments in Blogger

Assalamualaikum dan salam sejahtera,


PLEASE BACKUP YOUR TEMPLATE.

1. Go to Template > Edit HMTL, Ctrl+F:

div class='comments' id='comments'>

2. Place the code BELOW previous code:
<!--Facebook Comment Here-->
<div class='comments-tab' id='fb-comments' onclick='javascript:commentToggle(&quot;#fb-comments&quot;);' title='Comments made with Facebook'>
<img class='comments-tab-icon' src='http://static.ak.fbcdn.net/rsrc.php/v1/yH/r/eIpbnVKI9lR.png'/>
<fb:comments-count expr:href='data:post.url'/> Comments</div>
<!--Blogspot Comment Here-->
<div class='comments-tab inactive-select-tab' id='blogger-comments' onclick='javascript:commentToggle(&quot;#blogger-comments&quot;);' title='Comments from Blogger'>
<img class='comments-tab-icon' src='http://www.blogger.com/img/icon_logo32.gif'/> <data:post.numComments/> Comments</div><div class='clear'/>
</div>
<div class='comments-page' id='fb-comments-page'>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='fb-root'/>
<fb:comments expr:href='data:post.url' num_posts='5' width='400'/>
</b:if>
</div>
<div class='comments comments-page' id='blogger-comments-page'>

blue - you may change into something else than 'comments'
purple - you may change to cutier icon (fb/blogger) only
red - change:
             5 - number of comments
             400 - width (px)

<b:if cond='data:blog.pageType == &quot;item&quot;'>
add this to see the feature appears only in static pages only.

then find this code:
<head>

Paste the code BELOW previous code:
<script src='http://connect.facebook.net/en_US/all.js#xfbml=1'/>
<script src='http://code.jquery.com/jquery-latest.js'/>
<meta content='YOUR_FB_ID' property='fb:admins'/>
<script type='text/javascript'>
function commentToggle(selectTab) {
$(&quot;.comments-tab&quot;).addClass(&quot;inactive-select-tab&quot;);
$(selectTab).removeClass(&quot;inactive-select-tab&quot;);
$(&quot;.comments-page&quot;).hide();
$(selectTab + &quot;-page&quot;).show();
}
</script>
Change blue into your fb ID:
login to Facebook, the find your Facebook ID:
http://www.facebook.com/pages/YOUR-PAGE/XXXXXXXXXXXXXX

SAVE!

Not yet, find,
/*Comment---------------/

add the following code:

Design CSS:
.comments-page { background-color: #f2f2f2;}
#blogger-comments-page { padding: 0px 5px; display: none;}
.comments-tab { float: left; padding: 5px; margin-right: 3px; cursor: pointer; background-color: #f2f2f2;}
.comments-tab-icon { height: 14px; width: auto; margin-right: 3px;}
.comments-tab:hover { background-color: #eeeeee;}
.inactive-select-tab { background-color: #d1d1d1;}
change red into your desirable color code.

SAVE! View comment.

Sumber: Lyssa


Terima kasih baca, sudi-sudilah komen :) . 

No comments:

Post a Comment