Create Twitter Button with Counter in WP
As seen on the title, we will discuss how to create a twitter button to your web. Twitter button is different from the kind of tweetmeme or retweet button because it is the official twitter button.
Now some websites has replaced its tweet button with this official button. The reason of to use this button? First, this button allows the user to customize its appearance, including a counter tweet and without a counter. Secondly, it can simultaneously promote other tweeps with a little extra code. Well, that is good opportunity for a business network.

Your Twitter Button Code
You can place the Tweet button‘s code in the single.php, loop.php, index.php, page.php, category.php, and/or archive.php files.
1 2 3 4 5 6 7 8 | <script src="http://platform.twitter.com/widgets.js" type="text/javascript"> </script> <a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php the_permalink(); ?>" data-via="earlyedition" data-text="<?php the_title(); ?>" data-related="EarlyEdition:Inspiring to follow" data-count="vertical">Tweet</a> |
<script src="http://platform.twitter.com/widgets.js" type="text/javascript">
</script>
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="<?php the_permalink(); ?>"
data-via="earlyedition"
data-text="<?php the_title(); ?>"
data-related="EarlyEdition:Inspiring to follow"
data-count="vertical">Tweet</a>Let’s briefly code shown above.
data-url – This is the URL address will be shared (*No need to change).
data-via – You have to replace it with your twitter username.
data-text – This is the Title Post as “Update Status”.
data-related – Well this section is able to promote another twitter account as your recommendations. Example: “twitterusername:your descriptions” and my example above is “EarlyEdition:Inspiring to follow”.
data-count – you can customize counter model, like horizontal, vertical or without a counter. The options are vertical, horizontal, none.
As alternative, I have a little code following references from other web:
1 2 | <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script> <a href="http://twitter.com/share?url=<?php echo urlencode(get_permalink($post->ID)); ?>&via=earlyedition&count=horizontal" class="twitter-share-button">Tweet</a> |
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script> <a href="http://twitter.com/share?url=<?php echo urlencode(get_permalink($post->ID)); ?>&via=earlyedition&count=horizontal" class="twitter-share-button">Tweet</a>
The advantage of these alternatives code is simple and easy to use.
Source: http://www.wpbeginner.com/wp-tutorials/how-to-add-twitters-official-tweet-button-in-wordpress/
Related Posts:
- Limit Tag Cloud in WordPress Blog
Do you want set Tag Cloud limit on your wordpress blog? It is enabling help to control page rank flow. In order to limit the Tag Cloud on your wordpress blog, you have to edit the core file of the wor... - WordPress Breadcrumbs Without Plugin (advanced and easy method)
Breadcrumbs is an important element of a web site navigation and WordPress doesn't have a default way of creating breadcrumbs. You have to include the Breadcrumbs on your own themes, either by adding ... - Add Expires Headers to WordPress
This article have explained how you can add expiry header to your image, javascript and css files to speed up your site when loading.Adding expires headers do not affect the site load time for a f... - 3 Big Steps Wordpress Optimization
Here you have general rules but I think that this guide will be very useful specially for HostGator users. If your WordPress is not correctly configured you'll need a lot of GPUs for few thousands of ... - 10+ Best Wordpress Plugins for Google Adsense
Listed below are 10 best Adsense plugins which help you work smarter with wordpress.* Adsense Deluxe - offers advanced options for managing the automatic insertion of Google AdSense or Yahoo Publi...
Tags: button, Counter, Create, share button, social networking, twitter, Twitter Button, Wordpress, WP
You can leave a response, or trackback from your own site.
Leave a Comment
- EarlyEdition.Info
-
Recent Posts
Categories
-
© EarlyEdition.Info | RSS Feed
28 q. 0.508 s.