Skip to content

Instantly share code, notes, and snippets.

@mariemosley
mariemosley / pinterest.js
Last active September 28, 2022 15:17 — forked from 65/pinterest.js
pinterest buttons on every image in a Blogger/Blogspot post using jquery
<script type="text/javascript">
$(document).ready(function() {
$('.entry-content img').each(function(){
$permalink = $(this).parents('.post-outer').find('.timestamp-link').attr('href') || $(location).attr('href');
$title = $(this).parents('.post-outer').find('.entry-title').text();
$(this).addClass('pinme').after('<a href="http://pinterest.com/pin/create/button/?url=' + $permalink + '&media=' + $(this).attr('src') + '&description=' + $title + '" class="pin-it-button" count-layout="horizontal"></a>');
});
});