To avoid editing the plugin files themselves, you might be able to add it via jQuery; try adding something like this to your site’s custom js or in a <script> element in the footer, for example:
$('.tiled-gallery img').attr('nopin', 'nopin');
I haven’t tested this code, but it should set you on the right track.
Hi Richard,
Thank you for your suggestion!
I tried adding the below to my footer but it seems to not add any attribute…
<script type="text/javascript">
$(".tiled-gallery img").attr("nopin","nopin");
</script>
I tried replacing ‘.tiled-gallery img’ with simply ‘img’ to see if any img tags would add the attribute at all, but no luck. Do you have any idea why the script is not applying the attribute?
Example page: http://blog.froy.com/bond-street-loft-by-axis-mundi/
Nvm – I figured it out! Please delete last comment if needed.
Glad you figured it out! For the benefit of anyone else who comes across this thread, what did you find out?
Sure, happy to share.
I use the Genesis framework with a child theme. In order to make the script work when adding it in the end of the <body>
section, you have to understand that WordPress includes jquery by default but sets it in noConflict()
mode. This is to prevent compatibility problems with other JavaScript libraries that WordPress can link.
In order to make any script work in noConflict()
mode without using wp_enqueue_script()
, replace the $()
shortcut with jQuery()
.
So in my case, this did not work…
<script type="text/javascript">
$(document).ready(function() {
$(".tiled-gallery-item a img").attr("nopin","nopin");
});
</script>
but this did.
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".tiled-gallery-item a img").attr("nopin","nopin");
});
</script>