Just A Word...

Have a look at what we have to say. If you want to, leave a nice comment behind...


Social Links Without a Plugin: Part 2

Lets start out by making our social link code a little lighter by removing any whitespace, and wrap it in a < div> tag (you really can wrap it in whatever your use requires you to):

1
2
3
<div>
<a rel="nofollow" href="http://delicious.com/post?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Bookmark this post at Delicious"><img src="../images/delicious-16x16.png" alt=""/></a><a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink(); ?>" title="Submit this post to Digg"><img src="../images/digg-16x16.png" alt=""/></a> <a rel="nofollow" href="http://twitter.com/home?status=<?php echo urlencode("Currently reading: "); ?><?php the_permalink(); ?>" title="Share this article with your Twitter followers"><img src="../images/twitter-16x16.png" alt=""/></a><a rel="nofollow" href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Share this post at StumbleUpon"><img src="../images/stumbleupon-16x16.png" alt=""/></a><a rel="nofollow" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php echo urlencode(get_the_title($id)); ?>" title="Share this post on Facebook"><img src="../images/facebook-16x16.png" alt=""/></a><a rel="nofollow" href="http://reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Share this post on Reddit"><img src="../images/reddit-16x16.png" alt=""/></a><a rel="nofollow" href="http://identi.ca/notice/new?status_textarea=<?php the_permalink(); ?>" title="Share this on Identi.ca"><img src="../images/identica-16x16.png" alt=""/></a> <a rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" title="Share on LinkedIn"><img src="../images/linkedin-16x16.png" alt=""/></a><a rel="nofollow" href="http://www.newsvine.com/_tools/seed&save?u=<?php the_permalink(); ?>&h=<?php the_title(); ?>" title="Post on Newsvine"><img src="../images/newsvine-16x16.png" alt=""/></a> <a rel="nofollow" href="http://technorati.com/faves?add=<?php the_permalink(); ?>" title="Share this on Technorati"><img src="../images/technorati-16x16.png" alt=""/></a> <a rel="nofollow" href="http://buzz.yahoo.com/submit/?submitUrl=<?php the_permalink(); ?>&submitHeadline=<?php the_title(); ?>" title="Yahoo! Buzz this!"><img src="../images/yahoo-buzz-16x16.png" alt=""/></a>
</div>

Depending on where you wish the bookmarks to show, you can add style to the ‘plugin’ by using css. Now I know my websites tend to change around, so css is a must. I’m not going to show you any css markup, since yours and my uses along with placing will be completly different. But, since I’ve wraped it in a < div> tag, lets give it an ID for easy referencing when using css:

1
<div id="simplesocial"><a rel="nofollow" href="htt  [.......blah..........blah..........blah.......]  e=”Yahoo! Buzz this!”><img src="../images/yahoo-buzz-16x16.png" alt=""/></a></div>

Sweet! OK, now it’s time to place it in your ‘single.php’ template file (or any other template you want it to show).
Open it up, and find the best placement by testing out various positions, margins, padding, etc… Once you find the spot, you’ll know!

The working example is right below…Try it out, and enjoy the Bookmarking Plugin…without the plugin…..


About the Author

Kris J Has Written 13 Articles For Us!

Hey I'm Kris Jay, a WordPress Developer @ GDS. I'm usally hanging out in a local pub in Winnipeg, So if You're in Town, Drop Me A Note! Watch out for some Killer Upcoming Projects of Mine Due Out The End of 2010 and Begining of 2011...
Getting The Latest Tweet...
Did you know Kris has a website? Intriguing...