Using only Youtube ID
-
Hi,
I have this code in my single.php
[code] if ($format == 'video') {
if(isset($meta_values['meta_video_type'][0])){
if($meta_values['meta_video_type'][0] == 'vimeo'){
$data = $data . do_shortcode(' [vimeo clip_id="'.$meta_values['meta_attachment'][0].'" width="100%" height="340"] ');
}elseif ($meta_values['meta_video_type'][0] == 'youtube') {
$data = $data . do_shortcode(' [youtube id="'.$meta_values['meta_attachment'][0].'" width="100%" height="340"] ');
}elseif ($meta_values['meta_video_type'][0] == 'dailymotion') {
$data = $data . do_shortcode(' [dailymotion id="'.$meta_values['meta_attachment'][0].'" width="100%" height="340"] ');
}else{
$data = $data . $the_post_thumbnail;
}
}}[/code]
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!
- The topic ‘Using only Youtube ID’ is closed to new replies.