Created
March 6, 2023 02:19
-
-
Save mikeoberdick/46150b2ff1f7412da5b7203696df461e to your computer and use it in GitHub Desktop.
Conditional video script for either an ACF file or an oEmbed (YouTube video)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ($sectionTwo['video_type'] == 'file') { ?> | |
<?php $video = $sectionTwo['video_file']; ?> | |
<video class = "w-100" controls poster="<?php echo get_stylesheet_directory_uri() . '/img/poster.jpg'; ?>"> | |
<source src="<?php echo $sectionTwo['vide_file]; ?>" type="video/mp4"> | |
Your browser does not support the video tag. | |
</video> | |
<?php } else { ?> | |
<div class="embed-container"> | |
<?php echo $sectionTwo['youtube_video']; ?> | |
</div><!-- .embed-container --> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment