• Resolved diaritoch

    (@diaritoch)


    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!

    http://wordpress.org/plugins/video-thumbnails/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Unfortunately storing just the video ID in a field means the plugin won’t know what type of ID it is. Is this code part of a plugin or theme or something you’ve developed yourself? Perhaps it’s something I could support.

    I’d love this functionality as well. I’ve created a custom field so the author can simply copy/paste the YouTube ID (“XXXXXXXXXXX” rather than the full “http://www.youtube.com/embed/XXXXXXXXXXX”) and I’m looking for a way to keep it simple for them while also automatically generating the video thumbnail.

    I’ll probably come up with a hacky way to make it work in the meantime, but it’d be great if you could support just the ID’s. Thanks so much!

    I ended up editing the plugin code using a recommendation by you, Sutherland, adding my custom field to the settings and updating line 186 in video-thumbnails.php to:
    $markup = 'http://youtube.com/watch?v=' . get_post_meta( $post_id, $this->settings->options['custom_field'], true );

    Of course, I had to duplicate your plugin so my changes aren’t overridden on the next version, but hopefully you add the functionality so I can get back on the release track. Thanks again!

    Many WP users I’ve been in contact with are DESPERATE for this feature! This is because publishing images on one’s site that are downloaded/stolen from Youtube goes against Google’s Terms Service. It is equivalent to downloading their videos and then serving them from your own server, which is punishable. However embedding both their videos and thumbnails is completely ok. The risk in NOT doing it correctly is that they can shut down your entire Adsense account or even demote/de-list your site from Google search!

    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?

    Personally I would need it to function Custom Field embeds, but since your plugin already has this functionality, that shouldn’t be a problem, right?

    So any chance you could create this functionality asap?!? We REALLY need it!!! 🙂 Thanks.

    @WP-er: If you require assistance then, as per the Forum Welcome, please post your own topic.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using only Youtube ID’ is closed to new replies.