Search code examples
javascripttwittergoogle-plussocial-media

Add counter to social medias like twitter and google plus


I'm not too familiar with the API of Twitter and Google Plus. Can someone put some light in my problem? I want to add a counter to my Twitter, Google Plus and Stumble Upon button. This will be integrated in my wordpress post and pages. I think already implemented the facebook button. My only remaining problem are, Twitter, Google Plus and Stumble Upon (optional).

Thank You!

<!-- 
Facebook
/////////////////
--> 
    <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

    <a href="http://www.facebook.com/sharer.php?u=<?php echo urlencode(get_permalink()); ?>&t=<?php echo urlencode(get_the_title()); ?>"  name="fb_share" type="box_count" target="_blank" id="facebook">
    Share
</a>


<!-- 
Twitter
/////////////////
--> 

<a href="http://twitter.com/share?url=<?php echo urlencode(get_permalink()); ?>&text=<?php echo urlencode(get_the_title()); ?>" class="twitter-share-button" id='twitter' target="_blank">
    Tweet
</a>


<!-- 
Google Plus
/////////////////
--> 

<a href="https://m.google.com/app/plus/x/?v=compose&content=<?php echo urlencode(get_permalink()) . " " . urlencode(get_the_title()); ?>" id='gplus' target="_blank">
    Google Plus
</a>


<!-- 
Stumble Upon
/////////////////
--> 

<a href="http://www.stumbleupon.com/submit?url=<?php echo urlencode(get_permalink()); ?>" target="_blank" id='stumble'>
    Stumble
</a>

Solution

  • Twitter share count: https://twitter.com/about/resources/buttons

    Google+ +1 count: http://www.google.com/webmasters/+1/button/