Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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
    znello

    #1447384

    Hey znello,
    Try this solution to remove the first image.

    Best regards,
    Mike

    #1447795

    Hi 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
    znello

    #1447799

    Hi,
    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,
    Mike

    #1448459

    Hi Mike,

    thank you again ;-)
    You can close the thread now.

    have a nice day
    znello

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Custom Preview for Enfold Gallery’ is closed to new replies.