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.

Nội dung bài viết

Add My Posts to Digg

<a href="https://digg.com/submit?phase=2&amp;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="https://www.stumbleupon.com/submit?url=<?php the_permalink() ?>&amp;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="https://del.icio.us/post?url=<?php the_permalink() ?>&amp;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="https://reddit.com/submit?url=<?php the_permalink() ?>&amp;title=<?php the_title(); ?>" rel="nofollow"><img src="<?php bloginfo('template_directory'); ?>/images/reddit.png" alt="Add this Article to Reddit" /></a>

 

Add My Posts to Newsvine

<a href="https://www.newsvine.com/_tools/seed&amp;save?u=<?php the_permalink() ?>" rel="nofollow"><img src="<?php bloginfo('template_directory'); ?>/images/newsvine.png" alt="Add this Article to Newsvine" /></a>

 

Share this Article on Facebook

<a href="https://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="https://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.

Rate this post