Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1130913

    Hello,

    I have the same issue that in this topic

    but I didn’t use any third part plugin.

    I have a page that is containing text and several images.
    On one of them, I need a lightbox, but when I use lightbox in front, I see arrows and I can see in the same lighbox all other images of the page.

    I need to limit the lightbox to the image I want and not to group all the images of the page.

    I try the solution from the topic, with debug mode and post-entry class, but that doesn’t work.

    And idea ?

    Caroline

    #1130931

    best would be to see your site :
    but if i understand it right : you have the images not as image alb element but you have it in text-block alb inserted different images?

    so if you only wants to get rid of gallery function for those images and on a specific page only – you need your page-id
    here in my example code it is the : 5

    put the code ( change the page id) to your child-theme functions.php:

    function popup_no_gallery() { 
    if( is_page(5) ) {
    ?>
    <script type="text/javascript">
    (function($){
    $(window).load(function(){
        $('a.lightbox-added').magnificPopup({ 
    		type:  'image',
    		mainClass: 'avia-popup mfp-zoom-in mfp-image-loaded anchor-link',
    		preloader: true,
    		midClick: true,
    
    		gallery: {
    			enabled: false
    		},	
    	}); 
    });
    })(jQuery);
    </script>
    <?php 
    }
    }
    add_action('wp_footer', 'popup_no_gallery');
    #1130934

    Thanks for the answer,
    here is the link to the page

    I need that the recipe display alone in the lightbox, but, another image come with it.

    Is your answer still adapted ?

    Caroline

    • This reply was modified 5 years, 4 months ago by carosch.
    #1130938

    Ok, I try, it’s cool, that works, thanks a lot!

    #1130943

    your welcome

    #1131075

    Hi,

    I’m glad you got the help you need. If you need additional help please don’t hesitate to return to the forums.

    Best regards,
    Jordan Shannon

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Need to show only one image in the lightbox’ is closed to new replies.