Add A Pinterest Button To The Sharebar WordPress Plugin

by on Friday, March 30th, 2012

Pinterest LogoWe were looking to add the Pinterest button to our site’s Sharebar so that users could pin our content on their boards. After visiting Pinterest’s Goodies Page we saw that they have code that you can add to any page or plugin. However, the provided code doesn’t work properly.

When you click the button to pin that page, the window is supposed to scan images from the page for you to select from. Unfortunately, the image selector is blank thus not allowing you to pin anything.

After doing quite a bit of digging and testing other fan-made solutions, I came across a solution at Pinwire that works really well. It is a modified version of the bookmarklet that Pinterest also offers. It also includes the Pinterest social media share button image, and works really well too.

The only downside to using this method over the one that pinterest provides, is that it doesn’t display the number of pins that page has similar to the way other social media share buttons do. It is a small trade off to have something that actually works though, seeing as how the whole idea behind Pinterest is being able to pin an image.

How to Add Pinterest Button to Sharebar

  1. Go to Settings in WordPress and select Sharebar
  2. Click “Add New Button”
  3. Name your button “Pinterest”
  4. Input the desired position of the button
  5. Copy the code below and paste in the “Big Button” field
  6. Click “Add Button”
  7. Enable the button by checking the box to the left and click “Update” at the bottom
  8. You may want to reorganize your buttons also at this point by clicking the arrows

Pinterest Button Code

<a href="javascript:javascript:void((function(){var e=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)})());" title="Pin It!"><img src="http://passets-cdn.pinterest.com/images/pinit_preview_none.png"></a>