Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

twitter count not working

Posted on 2013-06-20
2
Medium Priority
?
249 Views
Last Modified: 2013-06-26
I got a script to put a twitter button on my site with a count.
yet, even though i tested it out and got people to click on it, it's staying at 0
the code looks like this
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://kars4kids.us/120huxG" data-text="I pledge not to txt and drive, u shud too!!! #TTYL #DontTextAndDrive" data-via="Kars4Kids">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</li>

Open in new window


What would I need to do to get a real count?
0
Comment
Question by:rivkamak
2 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39264114
Has twitter crawled your page?
Looking at that page you have a count of 15
And the URL in the code is redirecting - the page must be accessible.
0
 
LVL 16

Accepted Solution

by:
hankknight earned 2000 total points
ID: 39265883
Use this code instead:
<a href="https://twitter.com/share" class="twitter-share-button" data-via="http://kars4kids.us/120huxG" data-count="none" data-text="I pledge not to txt and drive, u shud too!!! #TTYL #DontTextAndDrive" data-via="Kars4Kids">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

Open in new window

If you want to customize it further, do so here:
https://twitter.com/about/resources/buttons#tweet

If you use that tool make sure to uncheck the "Show count" checkbox.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question