-
AuthorPosts
-
June 1, 2024 at 1:52 pm #1447274
Hello,
I created a Gallery with several images (Style: Large image, all others are reachable via Lightbox) The first image is automatically shown as the preview (495x400px). This one and all the others are visible in the lightbox by klick.
I would like to create a customer preview that is NOT shown in the gallery. Is that possible?Alternatively:
Is it possible to exclude the first image of the gallery-images in the lightbox? So i could place my customized image there as the first one.thanks in advance
znelloJune 1, 2024 at 10:26 pm #1447384Hey znello,
Try this solution to remove the first image.Best regards,
MikeJune 4, 2024 at 11:42 am #1447795Hi Mike,
thank you so much ;-) It works fine.
I put the code in the functions.php of the child theme.But I didn’t really understand this (my English knowledge…):
If you have this setup on more pages it should work as long as the order of the images are the same. But please check if you have other galleries that this is removing images that you do want to show the first image.
In this case we can modify it to only work on some pages, but I will need to know all the pages you want it to work on and all the pages you don’t want it to work on, and what you expect new pages to be, working or not.Is there an example-code to use the function just for a special page/special pages, that I could modify for the page/pages I need it?
I would like it just for all ‘gallery pages’, but not for a gallery within the blog i.e.
The other possibility would be to load the first image always double into the gallery ;-)Best wishes
znelloJune 4, 2024 at 12:02 pm #1447799Hi,
Glad that this worked, if you find that this is causing issues with galleries that you don’t want this to work on, try adding a custom class like: remove-first-image at all of the places you want it to work and then use this code instead:function remove_first_image(){ ?> <script> (function($){ $(document).ready(function(){ $( '.remove-first-image .avia-gallery-thumb a.first_thumb[data-onclick="1"]' ).remove(); }); })(jQuery); </script> <?php } add_action('wp_footer', 'remove_first_image');
If you have trouble please include an admin login in the Private Content area and a link to your page so we can be of more assistance.
Best regards,
MikeJune 5, 2024 at 10:07 am #1448459Hi Mike,
thank you again ;-)
You can close the thread now.have a nice day
znello -
AuthorPosts
- The topic ‘Custom Preview for Enfold Gallery’ is closed to new replies.