开发者

Tweet counter only shows more than 0 on root page?

I have the twitter button on the top of my page using the following code in my header file:

<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<a href="http://twitte开发者_运维技巧r.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a>

However, the count only shows the number of tweets we have on the root page, i.e., www.website.com. www.website.com/anything does not show a tweet count other than 0.

Does anyone have any solutions for this? Thanks in advance.


To always use the root page, add the data-url attribute to the anchor tag.

<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.website.com">Tweet</a>

Check out the Tweet button documentation for more options.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜