I have several different Pinterest options on the blog. The overlaid one for images, the sharing button at the bottom of each post and the little "pin it" buttons in my sidebar with the counters.
I manually created the sharing buttons at the bottom of the posts with this:
Code:
<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php if (has_post_thumbnail( $post->ID ) ): ?> <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘single-post-thumbnail’ ); ?> <?php echo $image[0]; ?> <?php endif; ?>&description=<?php the_title() ?>"><img src="http://farm9.staticflickr.com/8398/8693188926_538082c90a_t.jpg"/></a>
When I add this to the page:
Code:
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
I'm wondering if I can let it load the javascript for everything but that little button somehow?
This code does work for allowing the image to be custom:
Code:
<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://farm9.staticflickr.com/8398/8693188926_538082c90a_t.jpg'/></a>
Help?