Archived topic
Hide Single Pinnable (Pinterest) Image On Post
11 replies · Started by Tomas on March 28, 2018
Hey, Im trying to add an image to a post but without making it visible. I need it to be hidden but to show up when the user wants to "pin" the post.
I've read some guides on how to do this but the code they show doesn't seem to be working.
What they say is to instert the image code inside this one:
<div style=”display:none;”>PASTE IMG CODE HERE</div>
Is there any other solution to this?
Many thanks,
Tomas
You should be able to do something like that.
For example:
<img src="YOUR IMAGE URL" alt="" style="display: none;" />
Hey Tom!
Thanks for the quick reply. Your solution does work but there's a problem. It works fine on pc but it doesn't on mobile because I have AMP enabled for mobile devices. It actually works on mobile if you switch to the Non-AMP version but since my visitors will be seeing the AMP version on default I would need it to work there.
I guess that for it to work on the AMP version the image has to actually be inside the post. But I need it to be hidden. Is there any way to do this?
Many Thanks,
Tomas
Hmm, I'm not 100% sure unfortunately. You might find some info by Googling "Pinterest image hidden AMP" or something along those lines. I don't have a lot of experience with the Pinterest API.
Hey Tom,
I undestand, but I think that if you actually attatch the image to the post and then hide it, that should work. Is there any way to do that? Just how the code I first talked about, but with one that actually works.
Thnaks!
You could use the featured image and then hide it?
Otherwise you'll need to add the images to your content.
Yeah but I'm already using the featured image. So there's no other way to add an image to the content and then hide it?
You would have to add them manually I believe, unless you can find a plugin which does it for you.
Yeah I can add them manually to the content, what I need is a code with which I can hide them after adding them.
Just add style="display:none" to the image HTML:
<img src="YOUR IMAGE URL" style="display:none;" />
Perfect, thanks
No problem :)