Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #641650

    Hi Guys,

    I’m looking to add an image to a color section that will open up a lightbox gallery.

    Is there a way to set the image for the lightbox but not show that image in the actual gallery?

    Thanks

    #641658
    #641882

    Hi Robert,

    I’m not sure what you mean by that, are you looking to only show an image in a lightbox if the user clicks for instance a text link? Please try to explain a bit further if I’ve misunderstood you.

    Best regards,
    Rikard

    #641982

    Hi Rikard,

    No I want to use an image, you can see I already have one created. When the user clicks the image a lightbox gallery opens up. But as you can see the orginal image that the user clicks on is showing up in the gallery. We dont want the feature image to show in the gallery.

    See: http://scotwebtesting.co.uk/upvc-doors/

    #642083

    Hi,

    Please try adding this at the very end of your themes / child themes functions.php file:

    function gallery_remove_firstImg(){
    ?>
    <script>
    jQuery(window).load(function(){
         	jQuery(".avia-gallery-thumb").find('a.lightbox').eq(0).remove();
    });
    </script>
    <?php
    }
    add_action('wp_head', 'gallery_remove_firstImg');

    Please note that this will affect all thumbnail galleries. To target only specific galleries enable custom css class name and replace the class name “.avia-gallery-thumb” in the above code with a custom class name.

    Please refer to this link to enable custom css class name http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/

    Best regards,
    Vinay

    #642720

    Hi Vinay,

    That code didnt work. It only worked on the first gallery of the page.

    #643180

    Hi,

    The code was designed to work on the only lightbox gallery which was on the example page however it appears that the lightbox gallery has changed to a slider now. I could not notice any other lightbox gallery.

    Please let us know if there is anything we can help you with.

    Best regards,
    Vinay

    #643507
    #643932

    Hi,

    We are working on your ticket please wait while we update the results here soon.

    Please use the below code in functions.php make sure to remove the old code before installing this one :)

    function remove_firstImg_inLightBox(){
    ?>
    <script>
    	jQuery(document).ready(function(){
    		jQuery('a.avia-gallery-big').each(function(){
    			jQuery(this).siblings('.avia-gallery-thumb').find('a.lightbox').eq(0).remove();
    		});	
    	});		
    </script>
    <?php
    }
    add_action('wp_head', 'remove_firstImg_inLightBox');

    Best regards,
    Vinay

    • This reply was modified 7 years, 9 months ago by Vinay.
    #648712

    Hi!

    I changed the code to following one

    function remove_firstImg_inLightBox(){
    ?>
    <script>
    jQuery(document).ready(function(){
            jQuery("#composite-doors-range-section .avia-gallery .avia-gallery-thumb .first_thumb").remove();
    });
    </script>
    <?php
    }
    add_action("wp_head", "remove_firstImg_inLightBox");

    Please review your website now

    P.S.: That would be applied inside your color section with “composite-doors-range-section” ID. If you would like to apply it globally, please let us know!
    Cheers!
    Yigit

    • This reply was modified 7 years, 9 months ago by Yigit.
    #648714

    Perfect Yigit Thanks very much

    #648719

    Hi!

    You are welcome! Let us know if you have any other questions or issues

    Regards,
    Yigit

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Set image to open up lightbox gallery’ is closed to new replies.