Adding “nopin=true” attribute to images with NO class in lightbox gallery
-
Hi Team,
Issue: I can’t find the way to add “nopin=true” attribute to images in lightbox galleries with no class.
Example: this page here, just as on many other ones, there are plenty of images. And none of them have any class assigned to them, which is why I can’t find the right way to use a script to add a “nopin-true” attribute to them.
What I have tried: I have tried adding the following script:
<script>
jQuery(function($){
$(‘img.dummyclass’).attr(‘data-pin-nopin’, ‘true’);
});
</script>and it does work for those images I can add the “dummyclass” class to. However, most of the images do not have class and there is no way to add it to them. And changing “img.dummyclass” to something like “a.class img” or similar does not work.
Options: As far as I see it, there should be a way to either:
A. target the images without a class inside those a’s and div’s
B. add a class to such images (for example, .nopin)This way I want to hide most of the images as well as the YT cover image from being picked up by the Pinterest Share window.
Question: What is the best way to solve A and/or B above?
Thank you!
- This topic was modified 5 years, 2 months ago by .
- This topic was modified 5 years, 2 months ago by .
- This topic was modified 5 years, 2 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘Adding “nopin=true” attribute to images with NO class in lightbox gallery’ is closed to new replies.