Gambar di atas contoh share artikel blog via aplikasi t3pemula di facebook
sesuai judul artikel Cara membuat button share berbagi via aplikasi di facebook
langsung saja pertama-tama buat dulu aplikasi di facebook silahkan lihat disini
Cara membuat Aplikasi di facebook buat developer website
sudah buat aplikasi lanjut ketahap berikutnya login dulu ke BLOG > TEMA > EDIT HTML
"
<script>ganti tulisan YOUR APP ID dengan id aplikasi yang sudah di buat
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR APP ID',
status : true,
cookie : true,
version : 'v6.0'
});
$( '.fb-share' ).click(function(e){
e.preventDefault();
var image = $(this).siblings('img').attr('src');
FB.ui(
{
method: 'share',
href: $(location).attr('href') + '?og_img=' + image,
},
function (response) {
}
);
})
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>"
selanjutnya masih di dalam edit html simpan code ini di bawah tag <head> atau di atas </head>
<meta content='YOUR APP ID' property='fb:app_id'/>ganti tulisan YOUR APP ID dengan id aplikasi anda dan ID FB ADMIN ganti dengan id profil fb anda,
<meta content='ID FB ADMIN' property='fb:admins'/>
cara mengetahui id profil anda silahkan lihat di sini
Cara mengetahui ID profil Facebook / ID Grup / ID Halaman
masih dalam edit html cari code yang mirip
<b:includable id='shareButtons' var='post'>
simpan code ini di bawah code atas
<div id='share-buttons'>simpan kode css ini
<a class='fb-share' href=' data:post.url '>
<!--<a class='facebook' expr:href='"https://www.facebook.com/sharer.php?u= " + data:post.url ' onclick='window.open(this.href, 'windowName', 'width=550, height=650, left=24, top=24, scrollbars, resizable'); return false;' rel='nofollow'>-->
<img alt='share-Facebook' src=https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh6ifCkGi72JmcBtKi6R0O7WGtLqUO_beZVfbDnwibZ-1VbXlJJZIb1l6MhjArMEFNYAroL7rNYK0vIfAsQXzclWkZywwWu7Nf4r5Uo4u2N79aWFd8C3MfckvtFbMEfXcwKa8l-Hfzi6M/h120/fb-share.png '/>
</a>
</div>
di bawah <b:skin atau di atas ]]></b:skin>
#share-buttons img {save dan coba tes bagikan
width: 35px;
padding: 5px;
border: 0;
box-shadow: 0;
display: inline;
}
source code : https://codemiq.com/en/custom-image-fb-ui-facebook-share/
