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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.