Viewing 1 replies (of 1 total)
  • Here’s the basic idea:

    you can get the thumbnail for the video by using this address:
    https://img.youtube.com/vi/VIDEOIDGOESHERE/0.jpg (can also use 1.jpg, 2.jpg or 3.jpg)

    what I did was this:

    $output = get_the_content();
    $output = str_replace("https://www.youtube.com/watch?v=", "", $output);
    
    <p><a class="lbpModal" href="https://www.youtube.com/embed/'. $output .'?wmode=transparent&fs=1&hl=en&modestbranding=1&loop=0&iv_load_policy=3&showsearch=0&rel=0&theme=dark"><img class="video" src="'. get_bloginfo('template_url') .'/img/video.png" /></a><img class="videoPicture" src="https://img.youtube.com/vi/'. $output .'/0.jpg" />';

    I created an image to overlay on the thumbnail so you knew it was a video and tweaked that with css. This code loads the video image I made and the youtube thumbnail and the link is a property of the video image. The <a class="lbpModal"> is whatever class you set your secondary lightbox settings to be.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Lightbox Plus] Youtube thumbnail & Lightbox’ is closed to new replies.