Social Media Cheat Sheet for WordPress
One of the ways to get more exposure to your blog is by word of mouth advertising. Social Media makes that easy for us. You can encourage your audience to vote for your article or share your article in social media sites by incorporating Social Media Interactivity in WordPress. In this article we will show you how you can add social media icons for each post in WordPress.
This is a cheat sheet for WordPress and we will mention some of the top sharing icons used by bloggers. But before you just copy and paste each code, you will need to understand how it works.
Code for Page/Post Title
<?php the_title(); ?>
Your Page URL – SEO Friendly URL
<?php the_permalink() ?>
Your Short Branded URL (Tutorial)
<?php echo get_bloginfo('url')."/?p=".$post->ID; ?>
Your Current Theme Directory
<?php bloginfo('template_directory'); ?>
We are using the above codes in each social media embedding that we mentioned below. Since most people display this as mini icons at the bottom of the post, you would need to add those icons in your theme images gallery which is located at
/wp-content/themes/yourthemename/images/
Make sure to change the image format (.jpg, .gif, .png or other) and styling to fit your template needs.
The codes below will need to be pasted in single.php and/or page.php.
Add My Posts to Digg
<a href="http://digg.com/submit?phase=2&url=<?php the_permalink() ?>" rel="nofollow"><img src="<?php bloginfo('template_directory'); ?>/images/digg.png" alt="Add this Article to Digg" /></a>
Add My Posts to Stumbleupon
<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink() ?>&title=<?php the_title(); ?>" rel="nofollow"><img src="<?php bloginfo('template_directory'); ?>/images/stumble.png" alt="Add this Article to Stumbleupon" /></a>
Add My Posts to Delicious
<a href="http://del.icio.us/post?url=<?php the_permalink() ?>&title=<?php the_title(); ?>" rel="nofollow"><img src="<?php bloginfo('template_directory'); ?>/images/delicious.png" alt="Add this Article to Del.icio.us" /></a>
Add My Posts to Reddit
<a href="http://reddit.com/submit?url=<?php the_permalink() ?>&title=<?php the_title(); ?>" rel="nofollow"><img src="<?php bloginfo('template_directory'); ?>/images/reddit.png" alt="Add this Article to Reddit" class="left" /></a>
Add My Posts to Newsvine
<a href="http://www.newsvine.com/_tools/seed&save?u=<?php the_permalink() ?>" rel="nofollow"><img src="<?php bloginfo('template_directory'); ?>/images/newsvine.png" alt="Add this Article to Newsvine" class="left" /></a>
Share this Article on Facebook
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>" target="blank"><img src="<?php bloginfo('template_directory'); ?>/images/facebook.png" alt="Share this article on Facebook" /></a>
Share this Article on Twitter
<a href="http://twitter.com/home?status=Reading: <?php the_title(); ?> – <?php echo get_bloginfo('url')."/?p=".$post->ID; ?>" title="Click to send this page to Twitter!" target="_blank"><img src="<?php bloginfo('template_directory'); ?>/images/twitter.png" alt="Share this Article on Twitter" /></a>
We are using your short branded URL in this code.
You can also use the tweetmeme retweet button like we are using by following this tutorial.
Social Media Interactivity can also be incorporated in your posts by the use of famous plugins like Sharethis, Sociable, and Add to Any.
We feel that above codes are the most popular ones used, but if you think that there are other social media profile codes that should be included and you know the codes, feel free to let us know via comment, email, or twitter and we will add it here.
Comments
13 Responses to “Social Media Cheat Sheet for WordPress”Share Your Opinions
Tell us what you're thinking...
and if you want a pic to show with your comment, then get gravatar!
Please make sure that you have read our Comment Policy.










wow this is very helpful post, thank you so much..
Thanks for putting together this little resource. Really helpful.
It’s fine to have these codes but why we should use these codes if we already have one button “Share This” & many more.
Websudasa
That is because not everyone like Share This button. Some people do not want to install a plugin and have some bugs in it and get hacked. Plugins also slows down your site a little bit. Sometimes when designing a custom site, plugins might have aligning issues, which will require you to edit the plugin itself for displaying icons, and each time plugin upgrades, if you edited a core file, you will need to edit that and many other reasons….
Often, you may not get the output in the right style for your theme or you might want to create a custom interface that isn’t provided by any of the existing link sharing plugins for WordPress.
You could also put this functionality directly into your theme and provide theme customization options instead of getting blog owners to download and install a plugin.
Great! Thanks!
Great post. I’m sharing it on Twitter and have saved a PDF copy on HD to refer to later. I like having this option because sometimes my social media plugins don’t play well with other plugins and I don’t want to loose this functionality.
Thanks for sharing the above information.
However, I am still a little confused. Had gone thru the SEO friendly URL & understood that section. However for the above Code for Page/Post Title, Your Page URL, Your ShortBranded URL & Your Current Theme Directory, where are we supposed to paste the code?
How & Where do we find the single.php and/or page.php?
You are not suppose to paste those code anywhere. That is just a guide for your reference to see how the codes like Digg, Stumble and others are working. Which php tag refers to what, so you can use it for other services that you may want to include.
WOW! Finally! I’ve been looking for
this for over couple of month now.
All those sharing plugins suck, now I can
finally do my own thing!
Thanks!
Igor
This a great tip very useful.
nice tutorial, i am using wpsexybookmarks for this kind of purpose, i will be soon adding tweet button
Really good article, was looking at how to do this over the weekend but this was exactly what I needed. Cheers