Chykalophia | Graphic & Web Designer Menu Mobile
  • services
    • Expertise
    • Process
  • Portfolio
    • Finest Work
    • Gratis – Our Handout
  • journal
  • about
    • Chykalophia & Team
    • Creative Visualist
    • Idea Conceptor
  • contact

Latest Play

  • Rickshaw Republic Menu
  • #spring #bubbles http://t.co/31fg0aEfaZ ReTweet Reply Favorite
    (about 5 hours ago)
Follow @Chykalophia
  • Be Funny at Work, It's Good For You http://t.co/WSuwBgwX7G ReTweet Reply Favorite
    (about 2 hours ago)
Follow @PiotrKrzyzek
  • Spot a Weak Argument by Looking for the Word "Surely" http://t.co/SgQj3FrUkN ReTweet Reply Favorite
    (about 3 hours ago)
follow CKLPHgroup on twitter

Add Pinterest Pin It Button To WordPress Page & Post

37
23 Aug
2011
pin-wp

by Ari Krzyzek

Blog

freebies

Resources

tutorial

web design

Be social - share & spread the word

Tweet
I was working on one web design project for vintage event/theme rental company, Intaglio Vintage of which you have seen the teaser on my Facebook Page. And since Pinterest has been very common for the owners, I propose the idea of adding the Pinterest Pin It button for their blog post and inventories.

After researching for some plugin or similar feature for this, I only found the Pin It Button for the Bookmark on Website Browser. You can use it by simply dragging the button to your bookmark of either Safari, Chrome, or Firefox.

Another one is Pinterest Follow Button, which I have also added on Intaglio Vintage’s website header. Pinterest also provide the Pin It button for website which I thought could be the solution for this project. Sadly, this only works if you set the url of the website and url to the image of which you want people to pin. In the plus side, it works like the Facebook Like button as it comes with the count bubble.

Then I decided to grab the code from the Pin It Button for Bookmark, attach it on a button and add it to the website. After few test and help from PiotrKrzyzek.com, I managed to add the Pin It button (Designed by Chykalophia Design) to the end of the blog post as shown on the image below.

So now, how did we do it you ask? Here’s the cheat code you can use:

JavaScript
1
<a href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());"><img src="YOUR PIN IT IMAGE URL HERE" alt="Pin It" onclick="doPinIt();"/></a>

ps: Place the cheat code above under the content of your post or page. Do not forget to set the <img src=”YOUR PIN IT IMAGE URL HERE”> to your Pin it Button. Then, you can style it using CSS. :)

In addition to this post, I’d also like to share some freebies. Below are the preview on the Pin it Button I’ve designed. You can get the Pin it Button Collection from my Download page. Enjoy, and happy pinning!

For those who didn’t get it work, please make sure to change the Pinit button URL to your own button. However, if you would like to use the one I designed, simply copy and paste the code below:

JavaScript
1
<a href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());"><img style="margin: 0 0 -5px 0;" onclick="doPinIt();" src="http://chykalophia.com/images/pinit-compact.png" alt="Pin It" /></a>

And if you are familiar with the coding, I’m pretty sure you can also use the Pin it ribbon corner button I made to work. See my Showcase page for the live sample.


Facebook Comments

awesome comments

Powered by Facebook Comments

37
  1. Pingback: Pinterest: The ultimate guide (Blogger benefits and adding the Pin It button to your blog)

  2. jason

    September 1, 2011 at 12:33 am

    I couldnt get this to work. Using WP theme and have shortcodes built for FB, TW and G+1. really want to add the pinit button. the code pinterest’s site create doesnt work either.

    I copied and pasted your cheat (with my image) but to no avail. thoughts?

    • Ari Krzyzek

      September 1, 2011 at 9:10 am

      in which part of your website do you want it to be? There might be something wrong with the placing as it works perfectly fine on my post page and even on the showcase page.

      try placing this code:
      Pin It

      Place it on your blog-single.php or single.php file. You can add it on your blog post but in html view after the content, but you will have to fix the placement for the position using css.

  3. jason

    September 1, 2011 at 12:34 am

    PS… thanks for looking out for the rest of us. :)

  4. jason

    September 1, 2011 at 10:19 am

    Hey! thanks for the reply! I left a comment with a link to the page I put it on. It might have been deleted as potential spam. I altered it and placed it below.

    I’m not really worried about the CSS and alignment right now, I just want the darned thing to show up. Is there something wrong with the code as I’ve entered it?

    http://www (dot) merrimackandmonitor (dot) com/portfolio/fixed-pixar-plumbing-lamp/

  5. jason

    September 1, 2011 at 4:12 pm

    IT WORKS! You are awesome. Thanks!!

  6. KC

    September 13, 2011 at 9:27 am

    It’s not working on my site. It looks like this bit

    +Math.random()*99999999);document.body.appendChild(e)})());

    is not getting appended.

    http://uniimi.com/blog/2011/08/08/how-you-can-help-morgan-jason/

    (It’s in the floating bar on the right.)

    • Ari Krzyzek

      September 14, 2011 at 9:05 pm

      Thanks because your code was incorrect. Try to replacing it with this:

  7. KC

    September 15, 2011 at 9:47 am

    Hi Ari,

    Thanks for your response (and for the code in the first place)!

    Unfortunately I don’t see any code in your response.

    • Ari Krzyzek

      September 15, 2011 at 11:21 am

      I sent you the code on the email :)

  8. KC

    September 15, 2011 at 11:24 am

    Thank you so much! It works!

  9. jess

    September 17, 2011 at 8:43 pm

    thanks so much for this! it’s hard to find a good pinterest plugin out there. now, i’m seriously a novice, so please forgive the stupid question, but what do i do with the PSD to prep it to work for me?
    thanks in advance for your patience with my ignorance :)

    • Ari Krzyzek

      September 18, 2011 at 6:11 pm

      well the psd is actually an extra if you can play with the code and would like to use the buttons I have on the psd, you can use it on your web. :) but if you’re not familiar with coding, it should be best to leave it for now :)

  10. Michelle

    September 23, 2011 at 8:04 pm

    Thanks for the code. I created my own pin it img and placed it in my floating social widget. At first the code kept breaking but I figured out what was going on. The quotation marks surrounding the YOUR PIN IT IMAGE URL HER looked a little weird. I deleted and replaced them and it worked like a charm!

    • Ari Krzyzek

      September 24, 2011 at 10:04 am

      That’s good to hear, I checked the button you have, really nice and go along with your color theme :)

  11. Michelle

    October 25, 2011 at 12:47 am

    Thank you! This is so cool. :)

  12. Noah's Dad

    November 18, 2011 at 2:59 pm

    This is great. We do a daily video blog, and we have a lot of mommies that come to our site (and they all seem to really enjoy using Pinterest)

    If you have time would you mind looking at one of my single posts and let me know if this would work to the left of the posts where I have my shares. I believe I added those in my theme files.

    tanks for the great info!

  13. Ana White

    November 20, 2011 at 12:49 pm

    Just wanted to say thank you!

  14. Heather - Dollar Store Crafts

    November 22, 2011 at 10:15 am

    Another thank you here, and also I’m linking to your article from my blogging site Crafterminds.

  15. Monica

    November 23, 2011 at 12:23 pm

    Hi there! Thanks for the information on adding the “pin it” buttons to a blog. Unfortunately I was not able to get it to work b/c I am on WordPress.com (not .org) and it blocks java script! I was curious if you have any suggestions on getting around that with a button that is just an image that links to the “pin it” setup?

    Right now I have the code in place based on what is on Pinterest Goodies Section, and my site is defaulting to a link, rather than showing the button. It is automatically taking the original code shown as (Pin It
    ) and changing it to (Pin It)

    You can see how it looks at the bottom of this post… it works, but you can’t see the button… and I fee like that is so important! I would very much appreciate it if you have any suggestions!

    Thanks!

    • Ari Krzyzek

      December 6, 2011 at 6:09 pm

      Monica, I honestly don’t know how to help you since you mentioned that WordPress.com blocks Javascript :( I was going to suggest you the Pin It button from Pinterest Goodies Section, that’s what you can use for now.

      As for the button you mentioned that you can’t see, can you define on which button are you referring to?

  16. Monica

    November 23, 2011 at 12:28 pm

    Sorry code didn’t show Original: ‘a href=”http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fperdueosity.com%2F2011%2F11%2F21%2Fwe-did-it-its-our-photo-heart%2F&media=http%3A%2F%2Fperdueosity.files.wordpress.com%2F2011%2F11%2Fmg9270-x2.jpg&description=Framed%20Photo%20Heart%20for%20Wall!” class=”pin-it-button” count-layout=”none”>Pin It
    ‘

    Changed: ‘a href=”http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fperdueosity.com%2F2011%2F11%2F21%2Fwe-did-it-its-our-photo-heart%2F&media=http%3A%2F%2Fperdueosity.files.wordpress.com%2F2011%2F11%2Fmg9270-x2.jpg&description=Framed%20Photo%20Heart%20for%20Wall!” class=”pin-it-button”>Pin It</a'

    See what it looks like here: http://perdueosity.com/2011/11/21/we-did-it-its-our-photo-heart/

    • Ari Krzyzek

      December 6, 2011 at 6:12 pm

      ah… I see what you mean for the button. The problem is that you should have added the image reference as in the img src=”the URL of the image or button” see on the post above that I put the pin it button image inside the script. :)

  17. Anna Skye

    November 25, 2011 at 6:21 pm

    Thank you for this tutorial. Worked great, I was able to add it to my WordPress blog inside the singlepost.php file and it added it to all my old posts too!

    Pintrest is very addictive ;-)

  18. Colleen

    December 8, 2011 at 3:28 pm

    Excellent handy tutorial. I was able to easily incorporate this into the two self-hosted WordPress sites I publish.

    Any thoughts on how to include the Pin count, though? Pinterest does that on their “Pin it” button for website (Goodies), but, as you mentioned…that solution requires adding the button manually to ever single post.

    • Ari Krzyzek

      December 9, 2011 at 9:20 am

      Colleen, the main issue with the PinIt button with count is that the count only begins for one specific image, that is why it currently being set up as mentioned on the Goodies section.

  19. Jennifer Williams

    December 13, 2011 at 12:05 am

    I feel really dumb… I just want this darn thing to work and can’t figure out how to get it set up. I tried posting it in my single-post.php but that didn’t seem to do anything. Help?

    • Ari Krzyzek

      December 17, 2011 at 4:18 pm

      Jennifer: try placing it right after the post content inside your single-post.php or try placing it right above the “entry meta bottom”

  20. Pingback: How to add the Pinterest Pin It button to every post on your Thesis WordPress blog – Colleen's Commentary

  21. Viviana Baluja

    January 2, 2012 at 1:02 pm

    I really want to add the Pinit ribbon corner to my site. Did you provide the link above?

    • Ari Krzyzek

      January 3, 2012 at 10:05 am

      Hi Viviana,

      Sorry, but that’s more advanced and take more than 1 hour to figure out and testing it to work perfectly. Should you really need this for your website, contact me through the contact page and we’ll do our best to help :)

  22. Sophi Belle

    January 13, 2012 at 3:35 pm

    THANK YOU from the bottom of my heart. :)

  23. Kelly

    January 14, 2012 at 7:20 pm

    I took your directions, tweek’d it a bit and have it working perfectly for my sites needs. I of course gave you credit on the blog post I made. Just wanted to say thanks

  24. April

    January 21, 2012 at 10:47 pm

    Thank you so much for this! I got this working on my WordPress blog, but I also added it to my Zen Cart shopping site and it works there too. You rock!

  25. Ruby

    January 27, 2012 at 11:09 am

    Hi Ari, just wanted to say thanks so much for this tutorial and for the fabulous graphics. This didn’t work with my theme, but I came up with a different method which is working well. I’ve posted it here: http://www.tomaytotomaaahto.com/tools-and-tutorials/how-to-turn-your-images-into-pinterest-pin-it-buttons-wordpress and linked back to you. Please check it out and let me know if you object at all to my encouraging people to come and get your graphics. All the best, Ruby

  26. Pingback: Add a Custom Pinterest Pin It Button to your Website

  27. Pingback: The Pin It Button and some code

Comments are closed.

ask for quote

Custom designs are our best specialty here at Chykalophia Design.

Let\'s start your project

read on client reviews

We take pride on what we do. Read on some of the blushing words they write about us.

Hear what they say

direct delivery reads & updates

We don't abuse your email, but we do send out useful reads and updates about design


This site is part of Chykalophia Group LLC | Glenview, IL - US

Shop designs at Chykalophia Store

Established 2009. Chykalophia Design & its content
© All Rights Reserved - 2013

Tweet
Pin It