Last active
April 28, 2022 03:25
-
-
Save CFusionMM/232c0fd69f6a12177a12983484713680 to your computer and use it in GitHub Desktop.
ADV WP - Loom Video Shortcode
This file contains hidden or 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
function embed_loom_video_function() { | |
global $post; | |
$url = get_field('loom_video_link', $post->ID); | |
$ouput = '<div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="' . $url . '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>'; | |
return $ouput; | |
} | |
add_shortcode('embed-loom-vid', 'embed_loom_video_function'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment