Twitter Twit button is not working as expected


#1

Trying to integrate twitter twit button to my website (wordpress) and i am developing it as of now on my local machine (wampp server)

here is my code

<div class="wdt_button">
     <a href="https://twitter.com/share?text=<?php the_title(); ?>&amp;counturl=<?php  
       the_permalink() ?>"
       class="twitter-share-button" 
       data-url=<?php the_permalink() ?>
       data-via="Demo" data-lang="en" 
       data-count="vertical">Tweet</a>
      <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>     </div>

Though the button is appearing but when i am clicking on the twit button facing these problems

It is not showing the sharing URL
Counter is always coming as zero
This is what coming in the twitt box Not Enough via @Demo no URL is coming to share while the following URL is there on the browser address bar

https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Flocalhost%2Fblog%2Fwordpress%2F2011%2F10%2Fnot-enough%2F&source=tweetbutton&text=Not%20Enough&url=http%3A%2F%2Flocalhost%2Fblog%2Fwordpress%2F2011%2F10%2Fnot-enough%2F&via=Demo

but when i replaced data-url with a complete URL say www.travellingrants.com it shows this URL in the twits box but even after making few twits the counter still showing as zero.

can any one help me to resolve this issue
thanks in advance


#2

Twitter’s servers will not accept localhost as a valid address, the data-url property needs to point to a valid publicly accessible location. Try the button in production.


#3

@kurrik, i tried this one it not shows my data-url. can u help me. it’s my production setup.

Tweet

#4