Manually Add the TweetMeme Submit Button to WordPress

I enjoy using TweetMeme on my blogs, it is highly recognizable but the plug-in itself allows little control over placement on where you want the submit button. You can choose top, bottom, left and right, or update the location on specific posts, but I wanted to be able to set it inside a table and make it sit next to my other social submit buttons.

I found this information over on the TweetMeme forums and thought it would be nice to share it with my blog readers.allows me to deactivate the TweetMeme plugin and use this simple code instead to place the TweetMeme plug-in exactly where I want on my wordpress posts.

Disclaimer: Make sure you take a backup of your cs_functions.php and single.php before making any changes.  You will also want to make sure you have ftp or file access to your site, in case your wordpress crashes, you may need to have ftp or file access (ssh or telnet) to restore the backup file.

First, open your functions.php file and paste this code directly above the closing ?> tag at the end of the file:

function tweetmeme(){
?>
<div style=”float: right; margin: 5px 0 15px 15px;”>
<script type=”text/javascript”>
tweetmeme_url = ‘<?php the_permalink(); ?>’;
</script>
<script type=”text/javascript” src=”http://tweetmeme.com/i/scripts/button.js”></script>
</div>
<?php
}

Next, paste this simple tag into your single.php or page.php template file, at the place you wish the button to appear:

<?php tweetmeme(); ?>

This information was posted by Shawn Hesketh from WordPress 101, who left this comment on the Tweetmeme forums.

-Dragon Blogger

Justin Germino
Working in the IT Industry for over 17 years starting with OS, Networking and then moving into web based technologies including authentication and online security. Dragon Blogger has unique insights and opinions to how the internet and web technology works. An Avid movie fan, video game fan and fan of trying anything and everything new.
Justin Germino

@dragonblogger

Content Creator/Owner of https://t.co/iWP6afuOc9 for Tech, Game, Entertainment and streamer at https://t.co/594fXMdMIA
RT @EliteDangerous: To celebrate the reveal of Elite Dangerous: Odyssey, we've partnered with @OverClockersUK to give away a Kinetic Z4 gam… - 54 mins ago
Justin Germino
Justin Germino
Justin Germino

Latest posts by Justin Germino (see all)

Share Feedback We Want to Hear From You