I don’t know how to prevent certain images from being pinned – perhaps that’s something you could ask in the plugin’s forum. If there’s a special class or tag that prevents pinning of an image with your specific plugin, you might be able to accomplish that in a child theme.
Let me know how it goes.
Thread Starter
lina78
(@lina78)
<img src = “foo.jpg” nopin = “nopin” />
This is the code that prevents an image from being pinned. I just don’t know where to put it. The child theme only lets me edit the CSS, how would I go about inserting that code into the HTML?
The child theme only lets me edit the CSS
A child theme allows you to make all kinds of theme-file modifications, not just CSS, that’s one of its benefits over just using a custom CSS plugin. 🙂 Have a look at these guides to learn more:
http://codex.wordpress.org/Child_Themes
http://op111.net/53/
http://vimeo.com/39023468
So place a copy of header.php in your child theme, and edit line 40 from this:
<img class="custom-header" src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
to this:
<img class="custom-header" nopin = "nopin" src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
That should do the trick – let me know how it goes.
I’m already seeing the nopin="nopin"
code on your header image (and no Pinit button) – did you already figure this out?
Thread Starter
lina78
(@lina78)
Yes I was able to figure it out! I went into the actual theme’s HTML and fixed it there.
Great! I’d suggest you just move this change into your child theme, otherwise it’ll get overwritten every time you update the theme to the latest version. That’s one of the whole points of using a child theme, to protect changes from being erased when you update the theme. 🙂
Thread Starter
lina78
(@lina78)
I don’t see an option to edit the header.php in my child theme? That is why I didn’t do that before. Any idea why I am not seeing it in my child theme editor?
You need to make a copy of the file and place it in your child theme yourself. 🙂
Thread Starter
lina78
(@lina78)
Thank you for your help! I think for now I will leave it be {last time I tried to go into my site’s theme I completely crashed everything}. But again, I appreciate the advice!
Ha! OK. You’re actually safer not making changes in your parent (main) theme directly because you can always activate your parent theme if you mess up something in the child – that’s another benefit to child themes. 🙂 Let me know if you change your mind and I’m happy to walk you through it.