Site logo

Archived topic

Adding a data/dataset element to header logo

18 replies · Started by lunatrix on January 30, 2019

Viewing posts 1–15 of 19

I'm using a plugin (TastyPins) to add an automatic Pinterest pinning hover button to images. When adding images through the post editor there is a checkbox to disable the pin functionality.

To manually turn off the hover button for an image pinning can be by setting data-pin-nopin="true" attribute. How can I add this to my logo? It seems that it is only an issue on mobile, the hover button is not present when viewing on the desktop.

Also, it only seems to show up on an actual device - I don't see this behaviour when viewing the site in responsive design mode in Firefox Developer Edition.

Your code works. Except that I needed " " around true because it was converting to 1. I can see the data- attribute when I view source, but it's still not working. Looks like I will have to take it up with the TastyPins folks because the attribute is there, just not honoured.

Thanks for your help! I love this theme so much, and the support is excellent :)

No problem! Hopefully they're able to resolve it for you :)

Is there a way to inject the data attribute using css?

I don't think so, unfortunately.

I didn't think so, but thought I'd ask :)

Hey,
This solution only works for the desktop logo. Can it be made to work for the mobile header logo?
Thanks

Thanks!

Glad to be of help

.

Thanks again.

I added the snippet and the no pin attribute is working perfectly, however, now pagespeed says the logo doesn't have explicit weight and height. Is there a way to fix it?
Cheers

This archived topic is closed to new replies.