Home / Content Marketing / Add a Pinterest Pinit Button to WordPress
Pinterest_Logo

Add a Pinterest Pinit Button to WordPress

Pinterest is on quite an upswing in popularity… so much so that other social sharing sites are starting to lose some ground. I believe the advantage of Pinterest is that it’s a visual medium that’s well laid out to share information. While other sites have boring lists, the mozaic that Pinterest generates is simple to scroll through to find what captures your interest.

With that in mind, social sharing sites are fantastic traffic generators, so why not make it easy to share your content? Today, we’ve added a Pinterest Pinit button to our WordPress theme. It was pretty simple to do… and we even incorporated pulling the featured thumbnail button as the image URL.

If you would like a Featured Image to display, here’s theme code to add a Pinit button to your theme within the Loop:
<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' ); echo $thumb['0']; ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a>

If you don’t want to specify the image, here’s the alternative code:
<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a>

Also – be sure to add the Pinterest script to your footer.php
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>

For additional information on generating a Pinit button or to take a look at their other apps and features, take a look at the Pinterest goodies page. The folks at Buffer have also described How To Add The Pinterest Pin It Button To Your Blog And Let People Pin Posts With Pictures using the latest version of the Digg Digg plugin.

Get Affordable WordPress Help Now

About Douglas Karr

Douglas Karr is the founder of The Marketing Technology Blog. Doug is the CMO of CircuPress and CEO of DK New Media, an agency specializing in assisting marketing technology companies with their inbound marketing - leveraging social media, blogging, search engine optimization, pay per click and public relations. Their clients include Angie's List, GoDaddy, Mindjet and many more. Douglas is also the author of Corporate Blogging for Dummies.

Check Also

Agile Marketing 2016

The State of Agile Marketing in 2016

Almost 2 years ago, Jascha Kaykas-Wolff shared what Agile Marketing was and why corporations had …

14 comments

  1. You’re cutting edge.   I may be a little dense but that’s the first “Pin it” button I’ve seen.

  2. nvmnd i did it. It does not work if you don’t have a specific “featured image” set for your posts.

  3. ID), ‘thumbnail’ ); echo $thumb[‘0’]; ?>
    I owe you a whole heap of gratitude for this little gem, sir.
    Allowed me to fix up the ShareThis code for use on wordpress (ShareThis is nice but it sure needs a lot of tweaking before it’s useful).

    In case anyone happens upon this in the same situation as me:

    < span class='st_pinterest_hcount' displayText='Pinterest' st_img='ID), ‘thumbnail’ ); echo $thumb[‘0′]; ?>&description=’>

    Add any other bits you need like st_title st_url st_blahblahblah
    I hope this comment doesn’t get parsed…
    edit: goddammit it does get parsed, that’s pretty daft. Added a few spaces and bits so it displays.

  4. Hey actually I just found, 1 minute later, that you can do it this way:

    (inside head tags)
    <  meta property="og:image" content="ID), ‘thumbnail’ ); echo $thumb[‘0’]; ?>” />

    pinterest then pulls the image from this ‘opengraph’ malarkey. Spiffy!

  5. Uhm, can’t get the counter balloon. I’ve followed your hints step by step, everything works but the counter balloon. Any idea on how to fix this?

    • @twitter-61936398:disqus You must have count-layout=”horizontal” for the counter to appear to the right.  If you have that correct and you have the layout correct, you probably just have to wait for pinterest to actually update the count.  I don’t believe they display it when it’s zero.

  6. My experience with pinterest:

    I’ve used pinterest to optimize my site’s ranking and the outcome was good, it has improved from page 6 to 4rd spot of 1st page within 3 weeks.

    I found that the seller named “pinterest”, which ranked first when you search “pinterest” at Fiverr, has produced the best results on my websites. The seller pins my site with 75 different people, not sure how he did this, but it has improve my SERP’s ranking. I’ve tried 5 other sellers who offer pinterest gigs on Fiverr but they can’t improve my site’s ranking. I don’t know why.

    After using pinterest for SEO for quite some time, I’ve discovered some of its benefits:
    – Google loves social media signal.
    – Each pin is considered as 3 inbound links.
    – Links and images from pinterest are dofollow.
    – Remember to ping the links of the pins to get indexed by Google.

  7. As blogger I’m using pinterest to optimize my site’s ranking and the outcome was good, it has improved my pages. Thank you for this informative post! 🙂

Leave a Reply