Senin, 05 Desember 2011

Tutorial cara letak komen fb pada blog

Tutorial cara letak komen facebook pada blog versi ni ada sikit punya pelik
Mula2 login akaun FB kemudian pergi ke site ni

Facebook Developer



site name masukan nama blog
site url masukkan alamat lengkap url blog
cth :  http://blogger-blog-tutorial.blogspot.com

kemudian klik create app


lepas klik create app..cari pula create new app.. macam gambar di atas...

tulis app display name...
App namespace tu biarkan kosong
Tick pada i agree kemudian klik continue...


yang ni macam biasa la..masukkan word verification kemudian klik submit



bila keluar macam ni..copy App Id tu



copy kemudian save pada notepad...

Next step..pergi ke desbot---desaign---edit html----tick pada expand widget template...

cari code

<body>    -untuk template lama/classic

<body expr:class='"loading" + data:blog.mobileClass'>  - untuk template moden..

kemudian masukkan code di bawah selepas code yang dicari..



<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'GANTIKAN TULISAN INI DENGAN APP ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};

(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>


gantikan tulisan tu dengan code App Id tadi..

cth



<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '288372124539276',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};

(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>


kemudian klik preview...jika tiada error..kita pergi ke next step...

cari code

      <data:post.body/>

kemudian masukkan code di bawah selepas code yang dicari




<b:if cond='data:blog.pageType == &quot;item&quot;'><center><div style='background:#eee;border-radius:15px;'>
<script src='http://connect.facebook.net/en_US/all.js#xfbml=1'/>
<div><fb:comments width='450px' expr:title='data:post.title' expr:href='data:post.url' expr:xid='data:post.id'/></div></div></center>
</b:if>



kemudian klik preview jika ok save...selesai

Sekian

Tidak ada komentar:

Posting Komentar