How-to: Easily Link to Social Media Websites in Wordpress

- BY Eric/Steel Frog, August 4 2009 -

Link to Social Media Websites

Social media: where would the internet be without it? In a recent project, I’ve had to create quite a few links to various social media websites and have come up with a series of Wordpress-based links you can use in your next project. Note that the code samples below only include the opening anchor for easy integration.

The list is in alphabetical order for easy navigation.

I opted to use Wordpress’ built-in urlencode() function to generate a browser-friendly URL.

More information on this function can be obtained on the Wordpress Codex.

Del.icio.us

Example: Click here to submit this article to Del.ici.us.

<a href="http://www.delicious.com/post?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Submit this article to Del.icio.us">

Digg

Example: Click here to submit this article to Digg.

<a href="http://www.digg.com/submit?phase=2&amp;url=<?php the_permalink(); ?>" title="Submit this article to Digg">

Facebook

Example: Click here to submit this article to Facebook.

<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php echo urlencode(get_the_title($id)); ?>" title="Submit this article to Facebook">

Reddit

Example: Click here to submit this article to Reddit.

<a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Submit this article to Reddit">

StumbleUpon

Example: Click here to submit this article to StumbleUpon.

<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Submit this article to StumbleUpon">

Twitter

Example: Click here to Tweet about this article.

<a href="http://www.twitter.com/home?status=<?php echo urlencode("I am reading: "); ?><?php the_permalink(); ?>" title="Tweet this article">

No Comments

Leave a comment

Ask a question or post a comment! Comments are heavily moderated; anything too off-topic or flame-baiting will result in deletion.

Gravatars are enabled. If you don't have one, get one!

Your E-mail address is required but will not be posted.

You can use the following tags in your post:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>




Categories


Archives


Friends


Popular Posts

Subscribe & Stalk

Subscribe by RSS
Subscribe by E-mail
Follow me on Twitter
Follow me on Reddit


Twitter Feed

Latest project has me going two steps forward and three steps back. I love to hate Wordpress and PHP. We have a complicated relationship.  ]


Status & Notes

Major update upcoming. I will be changing the way I do business. Rather than freelance, I will be developing and selling various design products on the website. More information to come soon.

01.02.2010


Recent Comments

Comment hoikf said:

“Nice post. It is interesting and tasteful. Thank you.[...]”
» Read the rest

Comment Eric/Steel Frog said:

“Amanda - It sounds stupid, but make sure you're not using a black brush on a black background, and t[...]”
» Read the rest

Comment Amanda said:

“I've gotten through everything so far, but I can't get the sparkles to work. I've done all of the ne[...]”
» Read the rest

Comment blackmask said:

“pls u can make my pic like evil help me ![...]”
» Read the rest

Comment blackmask said:

“pls u make my pic like evil pls u can make my pic lk evil how ![...]”
» Read the rest