Skip to content

Instantly share code, notes, and snippets.

@CFusionMM
Last active April 28, 2022 03:25
Show Gist options
  • Save CFusionMM/232c0fd69f6a12177a12983484713680 to your computer and use it in GitHub Desktop.
Save CFusionMM/232c0fd69f6a12177a12983484713680 to your computer and use it in GitHub Desktop.
ADV WP - Loom Video Shortcode
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