4
Create Your Own Social Bookmark Button Links
Here's a quick lesson for how you can make you're own social bookmark links to provide you're readers a way to share and save you're posts easily. They will thank you for making a convenient way to do that....
List Of Social Bookmarks We'll Make
Here is a list of the social bookmarks links this will show how to make. It's basically the same one's as you see in the bar above here.
- Digg
- Delicious
- StumbleUpon
- RSS Feed
- RSS Feed Mail
Make A Function
It's real simple, just create a function that you can drop into your functions.php file like this.
// Create the Social bookmark bar
function my_socialbar() { ?>
<div class="socialbar">
<a href="http://twitter.com/home?status=<?php the_title(); ?> <?php echo get_permalink(); ?>" target="_blank" class="twitter" rel="nofollow">Twitter</a>
<a href="http://facebook.com/share.php?u=<?php echo get_permalink(); ?>&title=<?php the_title(); ?>" target="_blank" class="facebook" rel="nofollow">Facebook</a>
<a href="http://digg.com/submit?phase=2&url=<?php echo get_permalink() ?>&title=<?php the_title(); ?>" target="_blank" class="digg" rel="nofollow">Digg</a>
<a href="http://del.icio.us/post?url=<?php echo get_permalink() ?>&title=<?php the_title(); ?>" target="_blank" class="delicious" rel="nofollow">Delicious</a>
<a href="http://www.stumbleupon.com/submit?url=<?php echo get_permalink() ?>&title=<?php the_title(); ?>" target="_blank" class="stumble" rel="nofollow">Stumble</a>
<a href="http://feeds.feedburner.com/New2WP" title="Get the RSS Feed" target="_blank" class="rss">RSS</a>
<a href="http://feedburner.google.com/fb/a/mailverify?uri=New2WP" title="Get Email Updates Sent to Your Inbox" class="email">Email</a>
</div>
<!--socialbar-->
<?php } // end my_socialbar ?>
This contains all the HTML code you need to make the correct links for each social bookmarking link.
Call The Function
Here's how you call the function. Just add this to the theme template file you would like the links to show on.
<?php my_socialbar(); ?>
That's all! If you have any questions let me know in the comments below.
Shortlink:
Get automatic updates! Subscribe to Our RSS Feed or Get Email Updates sent straight to your inbox!






User Comments
( ADD YOURS )riesurya September 16
Very nice tips. btw, function to called into single post (based on snippet above) it look should be
(my poor english :D)
Name... October 7
This does not work. It is echoing the function.php
James Riter July 13
Thanks!
The only problem I am having is getting it to play nice with HTML5 and Validation.
I have changed all "&" with "amp;" now I am trying to take care of the Whitespace that is put in to each link. ?
Trackbacks