I am trying to create download links for images in a sidebar within a text widget—i.e. “Add Media”. This is to supply digital assets to the media. The download works with a PDF, but not with an image,
Here is the markup that works:
<a href="https://novabook.us/wp-content/uploads/2020/07/The-Labyrinth-in-Winter-media1.pdf" download="The Labyrinth in Winter-Media Release"><img class="alignleft size-full wp-image-10019" src="https://novabook.us/wp-content/uploads/2020/07/LAB-release-W.png" alt="" width="720" height="932" /></a>
Here is the markup that does not work:
<a href="https://novabook.us/wp-content/uploads/2020/07/The-Labyrinth-in-Winter-web-scaled.jpg" download="The Labyrinth in Winter cover-web"><img class="alignleft wp-image-10027 size-full" src="https://novabook.us/wp-content/uploads/2020/07/The-Labyrinth-in-Winter-web-scaled.jpg" alt="" width="1669" height="2560" /></a>
The image opens in a lightbox, but does not download as it should with this markup. How can I code these specific images so that they download and do not open in a light box?
I discovered ‘class = “noLightbox”‘ and that handled it. Thanks.
Hi blaircomm1,
We’re glad that you found the solution. :)
Let us know if you need further assistance.
Best regards,
Nikko