/** * Create shortcode for videos to be embedded into posts * Usage: [get-dm-player id="x4kds10" autoplay="false"] */ function getDmPlayer_shortcode($atts) { extract(shortcode_atts(array("id" => null, "autoplay" => false), $atts)); ob_start(); ?> <div class="video-embed"> <?php getDmPlayer($id, null, $autoplay); ?> </div> <?php return ob_get_clean(); }
<?php the_title('<h1 class="entry-title">', '</h1>'); ?> </header><!-- .entry-header --> <?php if (get_field('dailymotion_video_embed_code')) { ?> <div class="video-embed"> <?php $iframe_string = get_field('dailymotion_video_embed_code'); if (preg_match('/dailymotion/', $iframe_string)) { preg_match('/embed\\/video\\/([\\w+\\-+\\_+]+)[\\"\\?]/', $iframe_string, $match); $video_id = $match[1]; getDmPlayer($video_id, get_the_ID(), false); } else { echo get_field('video_embed_code'); } ?> </div> <?php } elseif (get_field('video_embed_code')) { // If video gallery if (have_rows('add_more_videos')) { ?> <div class="video-expanded-gallery"> <div> <div class="video-embed<?php