Opening gallery with the link on image

Hello,

I cannot figure out how to open the gallery on the same page by clicking on another picture that is not included in the gallery. I am talking about clicking on the top/first picture which would open gallery that is located down on that same page:


I tried this code with link to first picture in the gallery: 

<a href="https://croatiainvestin.me/wp-content/uploads/2018/10/1-2.jpg" rel="lightbox[sc_gallery-1]" data-type="gallery">

But it opens gallery but doesn't show the first picture it says: "the image could not be loaded" but offers arrows left and right and when I click them I can navigate through gallery normally, the only thing that won't load is the first picture in the gallery on which they are forwarded on.



Comments

  • Hi,
    I was looking at all of the images after clicking the main image, and I do not see the alert with "the image could not be loaded."

    Did you solve it?
    Also, which browser and OS do you use?
    Thanks
  • Hi Pablo,

    I saw you visiting my website on hotjar :D

    Well, I found a partial solution, with the following code:
    <div class="mask"><a href="https://croatiainvestin.me/wp-content/uploads/2018/10/1-2.jpg" rel="lightbox[sc_gallery-1]" data-type="gallery">

    The problem that remains is that when I put the link to the first image it loads it but when navigated to the right it shows the same picture again, so it shows the first picture twice which can confuse our clients. I tried to avoid that by putting the link to the last picture so when they go right they see the first picture and so on but that is not technically best and satisfying solution. 

    So can you give me some code which would override showing the first picture twice?




  • Unfortunately, this is not possible.
    It's inside the javascript script and I cannot customize it.

    This image is the first and last image, can you get rid of this image at the end?
    I mean, delete it from the gallery.

    Thanks
  • Theoretically, I could but then the people who would click on the gallery directly wouldn't see it.
  • I do not see other option.
    You would have to modify theme files, which we do not support.
    Cheers
Sign In or Register to comment.