What the heck is going on, you ask? Say hello to Tersus.

Bare bones? You got it. Tersus is an achingly simple WordPress theme without all the usual cruft. Please pardon the mess. This child theme is still under development.

CD

2010-08-12

Add a Tweet Button to WordPress Posts

Want to add a Twitter Tweet button to your WordPress posts? It’s super easy:

Horizontal Button:


[php]
<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php echo get_permalink(); ?>" data-count="horizontal" data-text="Check out <?php the_title(); ?> on < ?php bloginfo( ‘name’ ); ?>" data-via="YOURUSERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
[/php]

Vertical Button:

[php]
<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php echo get_permalink(); ?>" data-count="vertical" data-text="Check out <?php the_title(); ?> on < ?php bloginfo( ‘name’ ); ?>" data-via="YOURUSERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
[/php]

Simple, No-Count Button:

[php]
<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php echo get_permalink(); ?>" data-count="none" data-text="Check out <?php the_title(); ?> on < ?php bloginfo( ‘name’ ); ?>" data-via="YOURUSERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
[/php]

Customizing Output:

Updates:

This item was posted by Chris Harrison.

Categories:

Comments are closed.