-
AuthorPosts
-
June 1, 2016 at 6:34 pm #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
June 1, 2016 at 7:11 pm #641658June 2, 2016 at 7:42 am #641882Hi 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,
RikardJune 2, 2016 at 12:11 pm #641982Hi 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.
June 2, 2016 at 2:30 pm #642083Hi,
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,
VinayJune 3, 2016 at 9:34 pm #642720Hi Vinay,
That code didnt work. It only worked on the first gallery of the page.
June 5, 2016 at 7:51 pm #643180Hi,
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,
VinayJune 6, 2016 at 5:49 pm #643507Hi Vinay,
It has moved to http://scotwebtesting.co.uk/composite-doors/
June 7, 2016 at 10:30 am #643932Hi,
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 8 years, 5 months ago by Vinay.
June 15, 2016 at 4:36 pm #648712Hi!
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 8 years, 5 months ago by Yigit.
June 15, 2016 at 4:38 pm #648714Perfect Yigit Thanks very much
June 15, 2016 at 4:40 pm #648719 -
AuthorPosts
- The topic ‘Set image to open up lightbox gallery’ is closed to new replies.