上週在測試Blogger的點閱次數的功能失敗了,今天終於透過[Blogger Hacks]測試 MyHotPost 及增加每篇文章的點閱次數,知道可以藉由MyHotPost的JavaScript點閱數來完成這個功能:
文中的舉例:
<!-- quickedit pencil -->
<b:include data='post' name='postQuickEdit'/>
</span> <span class='post-backlinks post-comment-link'>
<b:if cond='data:blog.pageType != "item"'>
<b:if cond='data:post.showBacklinks'>
<a class='comment-link' expr:href='data:post.url "#links"'><data:top.backlinkLabel/></a>
</b:if>
</b:if>
</span> </div>
但是我的例子是這樣:
<!– quickedit pencil –>
<b:include data=’post’ name=’postQuickEdit’/>
</span> <div class=’post-share-buttons’>
<b:include data=’post’ name=’shareButtons’/>
</div> </div>
<div class=’post-footer-line post-footer-line-2′><span class=’post-labels’>
<b:if cond=’data:post.labels’>
<data:postLabelsLabel/>
<b:loop values=’data:post.labels’ var=’label’>
<a expr:href=’data:label.url’ rel=’tag’><data:label.name/></a><b:if cond=’data:label.isLast != "true"’>,</b:if>
</b:loop>
</b:if>
</span> </div>
不太一樣,後來我就直接加在<!– quickedit pencil –>的前面了:
點閱數:<script charset=’UTF-8′ src=’http://myhotpost.kengao.tw/jscript/pinfo/5c1f71515749faceebb67f8d95b31d18′ type=’text/javascript’/>
<!– quickedit pencil –>
<b:include data=’post’ name=’postQuickEdit’/>
</span> <div class=’post-share-buttons’>
<b:include data=’post’ name=’shareButtons’/>
</div> </div>
<div class=’post-footer-line post-footer-line-2′><span class=’post-labels’>
<b:if cond=’data:post.labels’>
<data:postLabelsLabel/>
<b:loop values=’data:post.labels’ var=’label’>
<a expr:href=’data:label.url’ rel=’tag’><data:label.name/></a><b:if cond=’data:label.isLast != "true"’>,</b:if>
</b:loop>
</b:if>
</span> </div>
一樣紅色這段要用MyHotPost給你的才可以!測試成功,Ya~!
想請教一要如何將blog首頁的點閱數弄成不是1呢?
記得myhotpost官方好像有說過要點進文章內部才有辦法顯示正確的點閱數~