Would It be able to exist the choice of creating the feature image’s filename using youtube id ?
https://www.ads-software.com/plugins/featured-video-plus/
]]>There are already WP plugs, such as Featured Video Plus, that have succeed in replacing WP’s featured image with a video, so it can’t be too hard to replace it with an image imbed. Maybe look into their coding for a clue?
So any chance you could create this functionality asap?!? We REALLY need it!!! Thanks.
https://www.ads-software.com/plugins/video-thumbnails/
]]>I have this code in my single.php
if ($format == 'video') {</p> <p> if(isset($meta_values['meta_video_type'][0])){</p> <p> if($meta_values['meta_video_type'][0] == 'vimeo'){<br /> $data = $data . do_shortcode(' [vimeo clip_id="'.$meta_values['meta_attachment'][0].'" width="100%" height="340"] ');<br /> }elseif ($meta_values['meta_video_type'][0] == 'youtube') {<br /> $data = $data . do_shortcode(' [youtube id="'.$meta_values['meta_attachment'][0].'" width="100%" height="340"] ');<br /> }elseif ($meta_values['meta_video_type'][0] == 'dailymotion') {<br /> $data = $data . do_shortcode(' [dailymotion id="'.$meta_values['meta_attachment'][0].'" width="100%" height="340"] ');<br /> }else{<br /> $data = $data . $the_post_thumbnail;<br /> }<br /> }</p> <p> }
I have the custom fields open and the only thing I see is id and then I see the value which is the youtube ID. I tried using meta_attachment, youtube_id and others but it still doesn’t find the thumbnail.
Please help!
https://www.ads-software.com/plugins/video-thumbnails/
]]>I’ve been getting to know WordPress pretty well for about a year using it to post daily videos and news. I’ve built my own template and found this function here to grab the first image of a post
// Get URL of first image in a post
function catch_that_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];
// no image found display default image instead
if(empty($first_img)){
$first_img = "DEFAULT-IMAGE";
}
return $first_img;
}
Well, I started using JR embed to give me flexibility with changing embed sizes in future layouts, and I decided I need to find a way to get the YouTube video ID from the post so I can have a loop with thumbnails of the videos… Is there a way to create a new function similar to the one for images so I can do this?
I have very little experience in PHP, and was hoping a nice soul might help me figure out how to create a function to do this, or to have a better way of managing the video posts within WordPress. I don’t want to use a custom field in the post because other people with less knowledge post updates.
Thanks in advance, I love the WordPress community!