其中這個按讚的功能對於很多人當重要~
多重要??架~~~~重~~~~~要~~~~~!!!!
除了類似長官簽名"閱"~或是說我喜歡你的文章~
亦或是說看著按讚人數的增加而得到莫名的成就感XDDDD
好啦~那我們到底要怎麼做才可以加入這個銷魂按鈕呢?讓我們繼續看下去.......
首先先到Like Button-Facebook開發人員這個網頁取得程式碼
依照參考資料說明傳送的功能"Send Button"僅用於 XFBML 的程式碼版本
但等一下會使用 iframe 版本,所以傳送功能在這裡要把這個選項取消~
而產生的式樣可以在下面預覽視窗中看到
按下Get Code->選取IFRAME並複製這段程式碼
接著到後台選取 版面配置->新增小工具->選擇「HTML/JavaScript」
假設我要把按扭擺在"愛凡塵的兩三小事"標頭下方
那就直接在下方新增小工具即可~如下圖:
完成後到Blogger檢視一下呈現的狀況,算是完成一段落了。
但如果我是要放在小工具可以擺放的位置以外呢?而且每篇文章各自分別計算讚次數?
比如是文章標題前~或文章標題後~或文章結尾處等等.......
那就必須將程式碼放到指定的位置囉~來看看吧~
首先我想把按鈕放在文章標題下方
先到後台->範本->選取"編輯HTML"
找到 <div class='post-header'> 這段標籤,然後將下面的程式碼加入到它的下一行
<div class='post-header-line-1'/>程式碼加入這邊</div>
**切記不要重複複製到<div class='post-header-line-1'/>...</div>標籤**
<div class='post-header-line-1'/>程式碼加入這邊</div>
**切記不要重複複製到<div class='post-header-line-1'/>...</div>標籤**
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class='post-header'> | |
<div class='post-header-line-1'/> | |
<script> | |
document.write('<iframe src="http://www.facebook.com/plugins/like.php?href=<data:post.url/>& | |
layout=standard&show_faces=true&width=450&action=like&font=verdana&colorscheme=light" | |
scrolling="no" frameborder="0" allowTransparency="true" style="border:none; | |
overflow:hidden; width:450px; height:65px"></iframe>'); | |
</script> | |
</div> |
完成後,可以發現按鈕已經加入到文章標題正下方了,而且分別計數每篇文章的讚
另外如果想放在整篇文章後面的話,就找
<div class='post-footer'> 這組標籤,同樣把程式碼加入標籤中~
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class='post-footer'> | |
<script> | |
document.write('<iframe src="http://www.facebook.com/plugins/like.php?href=<data:post.url/>& | |
layout=standard&show_faces=true&width=450&action=like&font=verdana&colorscheme=light" | |
scrolling="no" frameborder="0" allowTransparency="true" style="border:none; | |
overflow:hidden; width:450px; height:65px"></iframe>'); | |
</script> | |
<div class='post-footer-line post-footer-line-1'><span class='post-author vcard'> | |
<b:if cond='data:top.showAuthor'> |
以上,打完收工~^^
沒有留言:
張貼留言