Add Twitter to Bookmarks.php

Did you notice at the bottom of your post you have all those goodie bookmarks? Did you also notice that something was missing? That’s right twitter seemed to be missing from the list of bookmarks. Granted Twitter isn’t a bookmark but hey it’s nice to have.

Let’s add it!

Open up your bookmarks.php and right after this code:

<?php
$title_encoded = urlencode(get_the_title());
$link_encoded = urlencode(get_permalink());
$target = '_blank';
?>

Place this code:

<a title="Tweet this!" href="http://twitter.com/home?status=WPFood.com:+<?php the_title(''); ?> <?php echo $link_encoded ?>&amp;title=<?php echo $title_encoded ?>" target="<?php echo $target ?>"><img src="<?php bloginfo('template_directory'); ?>/images/ico-twitter.png" alt="Twitter!" /></a>

Remember to change the WPFood.com: above with your site name or whatever you want to put there.

After you’ve done that just download one or both of these twitter images:

Now put the image in you theme’s image folders. (Right click and Save As)

That’s it!

For additional support using the <?php the_title(”);?> see the WordPress Codex

See it in action below!

About Marco

I'm a WordPress Enthusiast and share what I learn about theme's plugins, code and reviews of everything WordPress

Leave a comment

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Your email is never shared. Required fields are marked *

You Might Also Like

Plugins »

WP125 Ad Management Plugin

Fri, Feb 27 2009 No Comments
WP125 Ad Management Plugin

With over 13,000 thousand downloads this plugin is hardly a secret but better than a secret is the fact that it works right out of the box. Its great for... 

Tools and Links »

Forums For Your Website

Fri, Feb 20 2009 No Comments
Forums For Your Website

I wanted to add a forum to this site so I decided to browse what was available and suitable for my needs. First I’m looking for something that’s...