Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi, you’re right that we call the pinit.js as well:

    https://github.com/Automattic/jetpack/blob/30a1cadb41062063ed87c546459cfe6a468a2325/modules/sharedaddy/sharing-sources.php#L1169

    Have you tried this plugin?

    https://www.ads-software.com/plugins/pinterest-pin-it-button-for-images/

    That might do it for you rather than coding your own. If you’d still like to try your hand at coding your own, though, it might be easier for me if you showed me some code that you’ve tried. Can you paste some code somewhere, like on pastebin.com that I could take a look at?

    Thread Starter froystore

    (@froystore)

    I inserted the below code right before the ending </body> tag and it works – pin it buttons show up on images upon hover.

    <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"
        data-pin-hover="true"
    ></script>

    However, it obviously calls pinit.js in addition to Jetpack.

    I tried adding the below code to Jetpack within the script loader AND deleting the above code so to avoid duplicate loading of pinit.js.

    s.setAttribute('data-pin-hover', true);

    The interesting part is, by doing this, the pin it button shows up on hover as intended, but only if you click into individual post pages. The buttons do not show up when hovering over images in the homepage, for example.

    I’m currently using the first option and loading pinit.js twice on my blog (https://blog.froy.com). I’m not sure what problems are supposed to happen if you have 2 pinit.js loading, but my site seems to be fine for now. Preferably, I’d like to use the second option to avoid loading it twice AND have the pin it button show up on all pages.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to edit Pinterest sharing code?’ is closed to new replies.