Hey guys, I’m trying to add Pinterest button on my Sharebar WordPress plugin here. So after a little research i found out what Pinterest is offering a goodies page where you can find a Pinterest button what you can use and add to your Sharebar WordPress plugin fast and easy. Pinterest pin button can be found here.
Don’t use the code in their goodies page, because it doesn’t work properly. It doesn’t open a proper popup button with images from your page, but just creates a link to pinterest page where you can create your pin there. If you want that button to open in a nice modal Pinterest window use the code what’s provided below.
<a title="Pin It!" 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)})());"> <img src="http://passets-cdn.pinterest.com/images/pinit_preview_none.png" alt="" /> </a>
The main problem with this code what’s given above it doesn’t show a number of Pinterest pins.
How to Add Pinterest Button to Sharebar
- Open your sharebar plugin settings page (http://yourdomain.com/wp-admin/options-general.php?page=Sharebar)
- Click “Add New Button”
- Name your button “Pinterest”
- Add a desired position for your button
- Copy the code below and paste in the “Big Button” field
- Copy the code below and paste in the “Small Button” field
- Enable the button by checking the box to the left and click “Update” at the bottom
Your “Add New Button” window should look like that. I will update this post if full solution with pins number gonna be available.
Thanks alot!! Exactly what i was looking for!!