Skip to content

Instantly share code, notes, and snippets.

@atomtigerzoo
Last active July 11, 2018 09:02
Show Gist options
  • Save atomtigerzoo/7da2f12b72da8b51c15743d7fd6ceea7 to your computer and use it in GitHub Desktop.
Save atomtigerzoo/7da2f12b72da8b51c15743d7fd6ceea7 to your computer and use it in GitHub Desktop.
Add 'pinthis' class to images that should have the pinterest button - Wordpress-Editor-inline-safe
<script async defer data-pin-hover="true" data-pin-tall="true" data-pin-save="true" src="//assets.pinterest.com/js/pinit.js"></script>
<script type="text/javascript">function defer(method){if (window.jQuery){method();}else{setTimeout(function() {defer(method)}, 50);}}defer(function(){ $("img").each(function(){ if(!$(this).hasClass("pinthis")){ $(this).attr("nopin", "true"); } });});</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment