Relative URLs
-
Using WordPress 6.1.1 and Simple Lightbox 2.9.3, all is ok when image <a href=”absolute URL”> but fails with relative URL. I hope it’s just because I’m not specifying the relative URL properly. Can someone help? I do wish to use relative URLs.
I can use relative URLs in the <img src=””> tag, and also in the <a href=””> tag if the target is not an image file (works with .txt file, for example) – so it appears that the plugin catches references to image files, but not with the relative URLs in the form I’m using.
Typical image code with absolute URL is
<!-- wp:image {"id":131,"width":768,"height":537,"sizeSlug":"large","linkDestination":"custom"} --> <figure class="wp-block-image size-large is-resized"><a ><img src="../wp-content/uploads/2023/01/Suns-refrain-Series-of-5-No-1.edit2_-1024x716.jpg" alt="Suns-refrain" class="wp-image-131" width="768" height="537"/></a><figcaption class="wp-element-caption">Suns-refrain-Series-of-5-No-1.edit2</figcaption></figure> <!-- /wp:image -->
Typical image code with relative URL (image shows ok, but no lightbox popout)
<!-- wp:image {"id":131,"width":768,"height":537,"sizeSlug":"large","linkDestination":"custom"} --> <figure class="wp-block-image size-large is-resized"><a href="../wp-content/uploads/2023/01/Suns-refrain-Series-of-5-No-1.edit2_-1024x716.jpg"><img src="../wp-content/uploads/2023/01/Suns-refrain-Series-of-5-No-1.edit2_-1024x716.jpg" alt="Suns-refrain" class="wp-image-131" width="768" height="537"/></a><figcaption class="wp-element-caption">Suns-refrain-Series-of-5-No-1.edit2</figcaption></figure> <!-- /wp:image -->
<a href=”../wp-content/uploads/2023/01/xxx.txt> displays the file ok.
The page I need help with: [log in to see the link]
- The topic ‘Relative URLs’ is closed to new replies.