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.
精彩评论