Disqus評論(留言)外掛安裝在Blog博客程序,希望想讀取最新的評論(留言),
投放在側邊欄位或想自由放在其他的頁面,我們可以通過官方給出的Widget調用代碼實現。
Disqus官方提供了四種不同的樣式▼
一、Recent Comments(最新評論)
<div id="recentcomments" class="dsq-widget">
<h2 class="dsq-widget-title">Recent Comments</h2>
<script type="text/javascript" src="http://your-websites-shortname.disqus.com/recent_comments_widget.js?num_items=5&hide_avatars=0&avatar_size=32&excerpt_length=200&hide_mods=0"></script>
</div>
二、Top Commenters(熱門留言)
<div id="topcommenters" class="dsq-widget">
<h2 class="dsq-widget-title">Top Commenters</h2>
<script type="text/javascript" src="http://your-websites-shortname.disqus.com/top_commenters_widget.js?num_items=5&hide_mods=0&hide_avatars=0&avatar_size=32"></script>
</div>
三、Combination(聚合評論)
<div class="heading blue">
<h2>Community</h2>
<script type="text/javascript" src="http://your-websites-shortname.disqus.com/combination_widget.js?num_items=5&hide_mods=1&color=grey&default_tab=recent&excerpt_length=30"></script>
</div>
四、Popular Treads(熱門文章)
<div id="popularthreads" class="dsq-widget">
<h2 class="dsq-widget-title">Popular Threads</h2>
<script type="text/javascript" src="http://your-websites-shortname.disqus.com/popular_threads_widget.js?num_items=5"></script>
</div>
注︰請修改網址your-websites-shortname為你Blog博客的shortname
例如: http://your-websites-shortname.disqus.com 修改為 http://yueguang.disqus.com
Shortname 如果你忘記了,可以在Disqus的控制台找到的,具體步驟請看▼
1. 前往WP的控制台 >> "迴響" >> 按一下"Disqus"
2. 在Disqus的控制台找到"Settings"
3. 在"Settings"頁面找到"Shortname"的欄位就是了
編碼說明︰
num_items 顯示數量
excerpt_length 字節(文字長度)
hide_mods 是否隱藏博主評論:0 顯示,1 隱藏
hide_avatars 是否隱藏頭像:0 顯示,1 隱藏
avatar_size 頭像尺寸:預設 32px/48px
最後: 如果你懂得HTML/CSS可以自行美化其樣式