Pinterest is one such website in recent time which people love the most. Like of its competitors Facebook and Twitter, a Pinterest button can be added to your blog posts in order to make it easier for people to add your content to their network. Using the following snippet, you will be able to insert the “Pin It” button within the loop.
1 | <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> |
Once done, open your footer.php file and add the Pinterest JavaScript code:
1 | <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script> |
Snippet source/Credit: MarketingTechBlog