
Contohnya seperti tombol diatas. Tombol ini akan terpasang di seluruh halaman posting blog, dan untuk setiap halaman posting berbeda-beda jumlah orang yang "like/recommend". Jumlahnya ya tergantung berapa banyak orang yang menyukai halaman / postingan tersebut.
Bagaimana menambahkan tombol facebook like di setiap post?
- Memasang Tombol di template Blogspot/Blogger (XML)
1. Login ke akun Blogger dan buka menu Layout > Edit HTML dan klik "Expand Widget Templates"2. Cari kode <data:post.body/>, dan simpan kode tombol facebook like dibawah ini persis dibawahnya.
<b:if cond='data:blog.pageType == "item"'>Kode ini hasilnya berupa tombol Like.
<iframe allowTransparency='true' expr:src='"http://www.facebook.com/plugins/like.php?href=" + data:post.url + "&layout=standard&show_faces=false&width=100&action=like&font=arial&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:450px; height:40px;'/>
</b:if>
3. Simpan Template.
Pilihan style untuk tombol.
a) Coba ganti action=like menjadi action=recommend. Dan hasilnya seperti tombol dibawah ini.b) Coba ganti colorscheme=light menjadi colorscheme=dark atau colorscheme=evil.
c) Spbat juga bisa mengganti jenis huruf yang digunakan dengan mengganti font=arial dan ganti dengan:
- font=lucida+grande
- font=font=segoe+ui
- font=font=tahoma
- font=trebuchet+ms
- font=font=verdana
- Memasang Tombol di template Wordpress.org (PHP)
Di menu Dashboard, masuk ke Appearance -> Editor (Themes editor). Buka template Single Post (single.php) atau Page Template (page.php). Carilah kode <?php the_content(); ?> atau<?php the_content('(Read the rest of this entry...)'); ?>
lalu di atas/di bawahnya tambahkan kode:
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php the_permalink() ?>&action=like&layout=standard&show_faces=true&width=450&font=arial&colorscheme=light" allowTransparency="true" frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe>
- Memasang Tombol di Sidebar/Widget/Halaman Statis (HTML)
<script type="text/javascript">
document.write('<iframe src="http://www.facebook.com/plugins/like.php?href=' + escape(location.href) + '&action=like&layout=standard&show_faces=true&width=100%&font=arial&colorscheme=light" allowTransparency="true" frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:100%; height:25px;"></iframe>');
</script>
Comments
Post a Comment