Pin It Button doesn’t work? Try this one
I had a weird problem with Pin It button present on my floating share bar. It came to notice when I didn’t find any pins in my profile. Pin button use to give pop-up and it was all ok. However, after pinning it nothing was getting posted. I dug it up and change many buttons from official page. Alas! All in vain.
I came to know from many sources that there is a problem with ‘href’. Official Pin Button works properly only when there is a valid static URL. Now, WordPress and PHP are all about dynamic pages. So, I tried using permalink also;
|
1 |
<?php the_permalink(); ?> |
It didn’t work. Second problem was with post titles and images. Pulling titles and images from dynamic URL is something that official code is not designed for. After so much Googling and code testing, I got which can be made to work. Idea came from a guy Ari Krzyzek.
This Pin button pulls post title automatically and also gives you an option to select images found in an article and also from related to it (Check below Screenshot). I am using the same for my manual floating social share bar.

Put the following code into a PHP file (single post or Main Index) of your theme;
|
1 2 3 |
<div class="sf-pinterest"> <a href='javascript:void((function()%7Bvar%20e=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)%7D)());'><img src='http://passets-cdn.pinterest.com/images/about/buttons/big-p-button.png' width='50' height='50' alt='Pin It'/></a> </div> |
I used DIV container so that you can also use styling in your theme’s stylesheet.css. You can modify the margins, heights and boundaries, etc.
|
1 2 3 4 |
} .sf-pinterest { YOUR STYLING CODES; } |
I hope this works for you. If you want a full working floating share bar with pre-included Facebook, Google+, Twitter, etc in just two steps then please refer this article.
Enjoy!
Mrinal Buddekar
Latest posts by Mrinal Buddekar (see all)
- Free 50 GB Lifetime Box.com for Xperia Android Still Working - May 19, 2013
- How to Setup and Configure TP-LINK TL-MR3020 - May 12, 2013
- Complete Review of TP-LINK TL-MR3020 3G/4G Wireless N Router - May 4, 2013