Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1495452

    Hi, I have an image that links to a Vimeo Video and, although I’ve set the URL manually to the Vimeo URL, and then set the image to open in “same window”, it does not open in a lightbox, which is typical; can’t seem to figure out why it’s not working. I did make sure that the Lightbox Modal Window is turned on in Theme Options.

    Help?
    Thank you!

    #1495454

    maybe this helps you on that:

    only to show that you can have video, websites or images in one lightbox group.

    INFO: due to GDPR ( DSGVO in Germany ) i can not show the working script for video content – it is hard to block this – playing videos from a masonry or from an image linked to a video.

    or not only for masonries:
    https://kriesi.at/support/topic/lightbox-pdf-not-working-shows-up-black-multiple-solutios/#post-1495451

    #1495455

    but btw. why don’t you use the video element and set your image as preview /fallback image on that element?
    On advanced privacy settings (on the video element itsself) you can choose to show the video in the lightbox.

    #1495574

    Hi Guenni007, Thank you so much, as always for assisting me! I have added the code you provided in the link, your first response. It’s there now and I am still using an image with the video link, attempting to have it open in a lightbox. Unfortunately, it did not work. Might you have any suggestions ?

    My reason for not using the Video element is that the Preview/Fallback image gets cut off – it makes it horizontal, when the image is actually vertical.

    So my Child Theme functions.php file now looks like this, but the video still won’t open in a lightbox…. Might you have any additional suggestions?

    <?php
    function lightbox_with_mixed_content_type() {
    ?>
    <script type=”text/javascript”>
    window.addEventListener(“DOMContentLoaded”, function () {
    (function($){
    $(‘.mixed-contenttype a’).each(function(){
    var anchorLink = $(this).attr(‘href’);
    if (/\.(jpg|png|gif|webp|jpeg)$/.test(anchorLink)) {
    //console.log(anchorLink + ” is an image link”);
    } else {
    $(this).attr(‘rel’, ‘lightbox’).addClass(‘mfp-iframe’);
    }
    });
    })(jQuery);
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘lightbox_with_mixed_content_type’, 999);
    /*
    * Add your own functions here. You can also copy some of the theme functions into this file.
    * WordPress will use those functions instead of the original functions then.
    */

    If you don’t think it’s possible to do this, I will make a horizontal image for the preview/fallback (doesn’t look quite as nice in terms of filling up the space), just thought I’d give it one more try.

    • This reply was modified 2 weeks, 5 days ago by Eleina_Shinn.
    #1495578

    Hi,
    I tested Guenni007’s solution and it is working for me. It looks like you forgot to add the custom class mixed-contenttype to the image element.
    qfLNKgt.png

    Best regards,
    Mike

    #1495663

    That worked, so sorry and thank you!

    #1495671

    Hi,
    Glad that we could help, and thanks to Guenni007 for the solution. If you have further questions please open a new thread and we will try to help. Thanks for using Enfold.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Image does not open video in Lightbox’ is closed to new replies.