Add Pinterest Script

Posted in: Newspaper
Post count: 39

Hi, all!

I wanted to add the hover “Pint it” button to all my images in my posts. I hava found a simple script to do the task, but the thing is I have to copy it in each post. So I was wondering were I can include this script ir order to automatically insert this hover button in all my posts images.

Code:

<script type="text/javascript" async data-pin-color="white" data-pin-height="28" data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script>;

Thanks in advance

Post count: 388

This plugin is outdated but still works on my install: https://wordpress.org/plugins/q2w3-inc-manager/

You could also manually add that to your single_… .php template files if you don’t want the overhead of another plugin.

Post count: 6600

Hi,

You can add it i the footer.php file like this: http://screencast.com/t/C5GTqIz4NZ or you can use the custom JavaScript option from theme panel: http://screencast.com/t/vQcy3DXp

Thanks

Post count: 39

Hi Lucian, thanks for answering .

The problem with adding the script in the fotter is taht ALL images are modified with the “Pin it” button. I only want the post images to get this button. Maybe in the single.php file?

Post count: 6600

Hi,

You can add it like this: http://screencast.com/t/vd79nzk4P this will affect the default post templates, you will have to make the same changes to the other post template if you need.

Thanks

Post count: 39

Hi Lucian thanks it works. Now the last thing I would need is to eliminate the “Pin it” button for the images in my widgets and in the realted posts.

Thanks in advance and nice weekend!

Post count: 6600

Hi,

Unfortunately you would need custom work for that as the pin it button it’s added via that JavaScript to all images/thumbs on post you would have to modify the JavaScript code that adds the button to your images: http://screencast.com/t/wyPkVdIJcmj
Unfortunately we cannot offer custom work as we work hard on the development, updates, fixes and support. You can always get a freelancer from sites like: http://studio.envato.com/ if you don’t know how to do it yourself.

Thanks

Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.