• First of all, I LOVE this plugin… how it works, how it looks, it’s literally perfect. Thank you for being so dedicated to Photoswipe!

    I just can’t figure how to exclude specific images from the lightbox gallery…

    Perhaps it’s my misunderstanding of how the basic gallery works in WP but I expected the Photoswipe plugin to only apply to the gallery at the bottom of the post instead of creating a lightbox gallery of every image on the page.

    The main images I would like to exclude are the thumbnail images in the “Related Posts” section at the bottom of the page. How do I achieve this?

    I’m not a developer so the documentation around adding specific gallery ID’s is hard to follow, sorry! Let me know what else I can provide in order to get this working how I’d like.

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    I don’t understand your problem. The “related posts” thumbnails don’t open in a lightbox. These are links to the posts.

    And about the backend options: Lightbox with Photoswipe will always use all pictures on a page. The only way to exclude a picture completely is not to link it to the media file. The option for separate lightboxes for galleries means only that the gallery pictures have their own lightbox – but other pictures will still be opened in a lightbox as well, just not together with gallery pictures.

    Plugin Author Arno Welzel

    (@awelzel)

    Ok, now I see the problem – the “related posts” links will open the posts when clicking them, but the featured images will be included in the lightbox, since there are also links to the image:

    
    <div class="sh-table-full">
                                        <a href="https://chasingsanddollars.com/thanksgiving-in-europe/" class="sh-overlay-item sh-table-cell">
                            <div class="sh-overlay-item-container">
                                <i class="icon-link"></i>
                            </div>
                        </a>
                    
                                        <a href="https://chasingsanddollars.com/wp-content/uploads/2014/11/IMG_4494-1024x768.jpg" class="sh-overlay-item sh-table-cell" data-rel="lightcase" data-lbwps-width="1024" data-lbwps-height="768">
                            <div class="sh-overlay-item-container">
                                <i class="icon-magnifier-add"></i>
                            </div>
                        </a>
                                </div>
    

    I don’t know why the “related posts” does not just inserts the image without a link to it. But anyway – this needs to be modified so the second link to the featured image is not generated. There is no other way to exclude it from the lightbox yet.

    For the next update I might add an option in the backend to exclude image links with certain CSS classes, like in your case sh-overlay-item sh-table-cell.

    • This reply was modified 4 years, 10 months ago by Arno Welzel.
    • This reply was modified 4 years, 10 months ago by Arno Welzel.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Lightbox creates gallery of all images on page, not just in the gallery’ is closed to new replies.