I'm using WP YouTube Lyte to show YouTube videos. I'm combining it with Advanced Custom Fields so that the user can just add the YouTube id to show the video. I'm using the WP YouTube Lyte short code but it is writing the code the wrong way round.
Below is the code:
<?php if( get_field('video_file') ):
$video = the_field("video_file");
?>
<?php echo do_shortcode('[lyte id="'. $video . '" /]'); ?>
<?php endif; ?>
Here is the result:
vTyDi22_SFohttpv://www.youtube.com/watch?v=
When I just add a YouTube id into the code it displays the video correctly.