1

I use markdown editor and insert an image by Insert Media, then I have, for instance,

<img src="path/saint-lary-piste-map.jpg" alt="saint-lary-piste-map" width="2084" height="1288" class="aligncenter size-medium wp-image-2337" />

<img src="path/Ax-les-Thermes-piste-map.jpg" alt="Ax-les-Thermes-piste-map" width="2000" height="1340" class="aligncenter size-full wp-image-2334" />

But the images are not clickable. To enlarge them, I have to right-click the image and click Open Images in New Tab.

I installed lightbox plugins. So, if the images are clickable, users can click to enlarge images in a pop-up window. How do I achieve this?


I checked with my previous posts using Windows Live Writer. There are clickable. Here is an example, HTML source code.

<a href="http://sparkandshine.net/wordpress/wp-content/uploads/2014/11/image5.png" data-rel="lightbox-2" title=""><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="image" src="http://sparkandshine.net/wordpress/wp-content/uploads/2014/11/image_thumb5.png" width="483" height="391"></a>
3

When using the Insert Media button, you need to set the Link To in the attachment details to the media file.

This is visible in the following picture in the bottom right:

enter image description here

  • Thx so much. Is it possible to add "Link To Media File" to all my inserted images in batch? – SparkAndShine Feb 6 '17 at 18:11
  • Unfortunately the "Link To Media File" is part of the image in the markdown editor, rather than a setting in the media library so there is no way to batch add. However you can do it quicker by clicking on each image in the editor, click the pencil option that pops up and set the Link To as "Link To Media File". You still need to do all of them, but won't have to do any image replacing. – mikeg542 Feb 6 '17 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.