BloggingPro logo

  • Blogging Jobs
  • Post a Job
  • Contact
  • WordPress Tips
  • Books for Bloggers
  • Services
  • RSS Blog Feed
  • RSS Blogging Jobs Feed
  • BloggingPro Starter Kit
    • The Secret Sauce to Freelance Writing on the Side
    • Swipe This! How to Create a Killer Copywriting Arsenal Using the Competition
    • How To Massively Grow Your Blog (In As Little As 30 Days)

How to Add the Pinterest Pin It Button To Your WordPress Blog

2/10/2012 by James Junior 9 Comments

Pinterest is all the rage these days. People just love pinning up pictures and graphics like there is no tomorrow. If you have a WordPress blog, then you can add the Pin It button to your blog pretty quickly. Here is what you need to do:

Copy and paste the following code right before the closing </body> tag in your theme file footer.php:

<script type="text/javascript">
(function() {
window.PinMe = window.PinIt || { loaded:false };
if (window.PinMe.loaded) return;
window.PinMe.loaded = true;
function async_load(){
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "http://assets.pinterest.com/js/pinit.js";
var x = document.getElementsByTagName("script")[0];
x.parentNode.insertBefore(s, x);
}
if (window.attachEvent)
window.attachEvent("onload", async_load);
else
window.addEventListener("load", async_load, false);
})();
</script>

Pin It Button

Once you have done that, make sure you update the footer.php file, or reupload it if you are editing the footer.php file any other way. You want the new version in place. Then, paste the following code into your single.php theme file wherever you deem appropriate. You might have to experiment a bit to realize the best possible location of the button for your blog.

<?php $pinterestimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
<a href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink($post->ID)); ?>&media=<?php echo $pinterestimage[0]; ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="vertical">Pin It</a>

Pin It Button 2

Now, here is what this button code does: Wherever you place the button code in single.php, on each post page there will be a Pin It Button. Once clicked, the code will pop open a little Pinterest window, and it will use the featured image of that post as the submission pic. Similar to this:

Pin It 3

There you go! Play around with it a little and you will find what works best for your blog. If you aren’t seeing any image in the pop up then your post doesn’t have a featured image specified for it. For best practices, always make sure you classify one image of each post as a featured image, because many plugins and buttons use the featured image slot.

Author: James Junior

I am a mid-thirties Writer and Internet Marketer from NY.

Filed Under: Blogger Tools, Blogging: How To, General Tagged With: pin it, pin it button, pinterest

Looking for flexible blogging and writing jobs?

Comments

  1. Kat says

    2/20/2012 at 5:21 pm

    You are the damn savious of the pinterest people!

    Reply
  2. Kat says

    2/20/2012 at 5:23 pm

    You are the damn saviour of the pinterest people! (you can delete that last typo comment). Thanks again! This saved me bunches of time trying to figure out how to write this out.

    Reply
  3. samsung 1080p hdtv says

    2/28/2012 at 12:17 pm

    I’m very impressed by how you have represented the information in this article. It’s apparent that you’ve done some extensive research. Thanks for this input. http://www.samsung1080phdtv.net/

    Reply
  4. The Snacker says

    2/29/2012 at 6:48 am

    Hmm, the image doesn’t show when I add this. Only the anchor text.

    Reply
  5. Hawaii Wedding Photographers says

    4/16/2012 at 10:19 pm

    You managed to really load this article up with information that is of real value. I appreciate good writing, and this is really good. I agree with the points you make here. Very nice work.

    Reply
  6. Hawaii Wedding Photography says

    4/20/2012 at 3:06 pm

    Many ideas have been written with standard views from what you wrote, but never have I seen such conviction and determination in the writing such a positive and pleasing document.

    Reply
  7. Dulcelina says

    4/25/2012 at 9:32 am

    thanks! great web site. thank you for the information this site is amazing. very well developed with great information.http://www.transportadoraramos.net

    Reply
  8. Alex says

    9/30/2012 at 6:48 pm

    is there any way to add pin button in thesis theme without plugin?

    Reply
  9. Elton Neufville says

    6/8/2013 at 11:41 pm

    Wow, awesome blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is wonderful, let alone the content!. Thanks For Your article about How to Add the Pinterest Pin It Button To Your WordPress Blog | BloggingPro .

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Please prove you're human *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Managed WordPress Hosting

Work for Bloggers

  • Writing Jobs
  • Online Content Jobs
  • Editing Jobs
  • Blogger Jobs
  • Publishing Jobs
  • Copywriting Jobs
  • Telecommuting and flexible jobs at Flexjobs

Blogging & Writing Work

  • Writing Jobs
  • Online Content Jobs
  • Editing Jobs
  • Blogger Jobs
  • Publishing Jobs
  • Telecommuting and flexible jobs at Flexjobs

DISCLAIMER

A few things we'd like to share with you

BloggingPro © 2021 Splashpress Media