Hi guys, i´ve tried to put the image as background on a div, but i've made a button to play the video. but as i don't call with the_post_thumbnail(); i can't get the video to play, can you give me a hand please?
<div class="lastnews"> <?php $args = array( 'post_type' => 'videos', 'posts_per_page' => 1 ); $loop = new WP_Query( $args ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php $feat_image = get_the_post_video_image_url( $post_id ); ?> <a href="#" class="play fvp_overlay" onclick="return false;"></a> <div class="videothumb" style="background-image:url('<?php echo $feat_image; ?>'); background-size: cover;"></div> <div class="post"> <div class="fecha"><?php the_time('l, j \D\E F, Y') ?></div> <div class="titlepost"> <a href="<?php the_permalink();?>" class="post-title"><?php the_title();?></a> </div> </div> <?php endwhile; ?> </div>
This just opens the black overlay, but won't play the video. Thanks since now.