• Resolved ftb

    (@misomaybe)


    How can I open a gallery page from a link?

    I tried to do it with jetpack carousel and with the carousel without jetpack and I can’t find a solution for that which is really annoying.

    I do not want to have a thumbnail gallery of my images. Instead I’d rather just have one image that would link to the slider.

    Could anyone help me with that?

    I am really stuck now…

    Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Anonymous User 5826054

    (@anonymized-5826054)

    Hi mm, Follow these steps:

    1. Create a Page with a gallery or carousel
    2. On the page you’re linking from, add an image to the post/page
    3. In the post edit form, click on the image and the insert a link.

    This turns the image into a link. I hope that helps. Let me know if you have any problems.

    Thread Starter ftb

    (@misomaybe)

    Hello,

    Thank you Kevin for your answer.
    Unfortunately, when using jetpack’s “carousel” or “carousel without jetpack”, if I add the link to the gallery itself, it will bring me to the gallery page and only then open the carousel.

    I need to open the carousel directly from the image link.
    I don’t want people to see the images of the carouself displayed as thumbnails.

    Any idea of which code I should use for that?

    Thank you again very much for your help… I am really stuck with this.

    Anonymous User 5826054

    (@anonymized-5826054)

    Oh, I see. You want to link directly to the full-page image carousel, right?

    That’ll be tough and I’m not sure if there’s a good way to do that. I’ll look around and let you know if I find anything.

    Thread Starter ftb

    (@misomaybe)

    yes.

    i am using carousel without jetpack now.. but i think it is built more or less the same way…

    thank you very much for looking.

    i really appreciate.

    Anonymous User 5826054

    (@anonymized-5826054)

    It looks like one way to modify the output is to use the post-gallery filter hook and create a new function to override gallery_shortcode

    There are some good discussions on StackExchange WordPress:

    https://wordpress.stackexchange.com/questions/43558/how-to-manually-fix-the-wordpress-gallery-code-using-php-in-functions-php

    https://wordpress.stackexchange.com/questions/58053/how-do-i-change-the-gallery-that-is-inserted-in-the-post/58077#58077

    https://wordpress.stackexchange.com/questions/2393/how-can-i-alter-the-gallery-markup

    Sorry I can’t be more help right now. If I can figure out the exact coded needed for your requirements, I’ll let you know.

    Thread Starter ftb

    (@misomaybe)

    OK wow.

    Good idea but still looks pretty much like Chinese to me.

    And hmm…I am wondering why it would not be possible to call the carousel opening a specific gallery from a link since the gallery does it.

    But yeah I have no clue how to do that either.
    Probably not possible…too easy that would be I guess.

    If you manage to figure that out…you’re pretty good.

    Anonymous User 5826054

    (@anonymized-5826054)

    I found another way to do this on WordPress StackExchange

    – First add an image with a custom link to your post
    – Change the link to the specific Jetpack carousel gallery by adding #jp-carousel-## to the end of your current post URL. ## is the first image ID in your gallery.
    For example, if my post id is 35 and the first image in my carousel is 55, then my link will look like this:

    <a href="https://www.example.com/?p=35#jp-carousel-55/"><img tag.../></a>

    – Next in your post editor (Text tab) add the following div to hide the gallery from the post:

    <div style="display: none;">
    [gallery include="##,##,##,##"]
    </div>

    – Finally, add the following CSS to your child theme’s style.css file:

    #gallery-link .tiled-gallery-item { display: none; }
    #gallery-link .tiled-gallery-item:first-child { display: block; }

    I tested it out and it works great. Thanks to hearvox for the tip. Let me know if you have any problems.

    Thread Starter ftb

    (@misomaybe)

    Hello Kevin,

    I have tested and still, it would bring me to the thumbnails page first…

    So this is the code i added to my testing page:

    <a href="https://mysite.com/wp/gallerytestpage/#jp-carousel-696"><img class="alignleft size-medium wp-image-783" alt="alt text" src="https://mysite.com/wp/wp-content/uploads/image_100-600x385.jpg" width="600" height="385" /></a>
    <div style="display: none;">
    
    [gallery include="696,800,684,624,701,772,776,703,805,625,702,806,699,698,700"]
    </div>

    and this is what i added to my custom css in my child theme:

    https://mysite.com/wp/roma-testgal/#jp-carousel-696 .tiled-gallery-item { display: none; }
    https://mysite.com/wp/roma-testgal/#jp-carousel-696 .tiled-gallery-item:first-child { display: block; }

    I am not sure why it doesn’t work for me.
    I probably did something wrong…

    But what?

    Thank you very much again for your help.

    Anonymous User 5826054

    (@anonymized-5826054)

    The CSS can be copied exactly as I posted, there’s no need to modify it.

    If you click the link from another page, it will briefly take you to the one image gallery page and then open up the carousel. If you open the link from the same page, the carousel should open right up.

    Thread Starter ftb

    (@misomaybe)

    Ohhh moving it to the same page and changing the code did the trick.
    Wonderful! Thank you do much for helping me with this. I really appreciate it. Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to open a gallery from a link????’ is closed to new replies.