Pennf0lio
Pennf0lio

Reputation: 3896

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>

Upvotes: 0

Views: 1516

Answers (3)

andrefrd
andrefrd

Reputation: 11

You can use jQuery to get the counters...

I have a gist that does that for Facebook Pinterest and Twitter https://gist.github.com/andrefrd/9520512

Upvotes: 0

user2309887
user2309887

Reputation: 9

 <div class="addthis_toolbox addthis_floating_style addthis_counter_style"    style="left:50px;top:160px;">
 <a class="addthis_button_facebook_like" fb:like:layout="box_count"></a>
 <a class="addthis_button_tweet" tw:count="vertical"></a>
 <a class="addthis_button_google_plusone" g:plusone:size="tall"></a>
 <a class="addthis_counter"></a>
 </div>
 <script type="text/javascript">var addthis_config = {"data_track_addressbar":true}; </script>
 <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5178354276acf324"></script>

Upvotes: 0

abraham
abraham

Reputation: 47833

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

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

Upvotes: 1

Related Questions