Pinterest is a vision board-styled social photo sharing website and app where users can create and manage theme-based image collections. Users of Pinterest curate themed image boards, populating them with media found online using the “Pin It” button, or uploaded from their computer. Each such item of media is known as a “pin,” and can be a picture, a video, a discussion or a monetary gift. Pins can be grouped into “boards,” which are sets of pins created on a given topic.
1. Plugins
Pin it Button mimics the behavior of the official Pin It bookmarklet and you have the option of placing it above or below your post content. Just go to Settings > Pin It Button in your WordPress admin after installing.
2. Hand-coded
Add one of the following code to the bottom of the footer.php, put that before
<!-- Include ONCE for ALL buttons in the page -->
<script type="text/javascript">
(function() {
window.PinIt = window.PinIt || { loaded:false };
if (window.PinIt.loaded) return;
window.PinIt.loaded = true;
function async_load(){
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
if (window.location.protocol == "https:")
s.src = "https://assets.pinterest.com/js/pinit.js";
else
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>
a. You want Pinterest to grab the first image of the post
Add the following to your template (single.php) where you want the ‘Pin It’ button to appear.