As a blogger or website owner, your goal is probably to attract traffic to your website. While facebook and twitter are definitely the two bigger social networking sites, Pinterest is also bringing lots of traffic to blogs. So what about adding a pinterest “Pin It” button to your blog? Let’s do it.
The first thing to do is to paste the following snippet where you’d like the “Pin It” button to be displayed. Note that this code must be inserted 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>
Thanks to Douglas Karr for the cool code!