I’ve written a tutorial on modifying a theme so Video Thumbnails can scan custom content.
I think in your case this simple modification may work:
function custom_vp_video_thumbnail_markup( $markup, $post_id ) {
return vp_metabox(‘video_options.embed_code’) . ' ' . vp_metabox(‘video_options.youtube_url’) . ' ' . $markup;
}
add_filter( 'video_thumbnail_markup', 'custom_vp_video_thumbnail_markup', 10, 2 );
If it works it’d be a big help to forward to your theme’s developer and suggest they add native support for Video Thumbnails. They can also contact me if they have any questions.
I assume that I would throw the above code into my functions.php?
hmm.. it is still not working.
I’m using both the batch process and the video thumbnail in each post methods and both are coming up empty.
Do I put anything in the settings for Custom Field?
I wish I could show you what’s going on, but I do all of my development locally on XAMPP so I can’t show you directly what’s going on.
You can leave the custom field setting empty. Since it’s a paid theme and I can’t check out their source code, unfortunately I’m not sure if there’s anything else I can suggest.
It’s likely the vp_metabox()
function isn’t aware of what the current post ID is, so maybe the developer could tell you if there are any other arguments it can accept. If that was the case you might be able to use something like vp_metabox( 'video_options.embed_code', $post_id )
, but like I said I can’t really tell you.
Another thing to check is that in the code you copy/pasted is that the ‘ symbol is the regular one and not the curly ones, I just noticed when I copied and pasted from your original it was using the curly ones.
From what I’ve gathered, the actual data that is being stored in the database in the post_metadata table with the following values:
meta_id XXX
post_id XXX (links the meta to the post data)
meta_key video_options
meta_value a:4:{s:10:”video_type”;s:11:”youtube_url”;s:12:”video_upload”;s:0:””;s:11:”youtube_url”;s:42:”http://www.youtube.com/watch?v=0mQaIMYIvYU”;s:10:”embed_code”;s:0:””;}
As for the code, that’s the code the author of the plugin gave me, I’ll double check with him, but he’s “on vacation” for the next two weeks and hardly checks his email… his words not mine.
This might work for you:
function custom_vp_video_thumbnail_markup( $markup, $post_id ) {
$vp_meta = get_post_meta( $post_id, 'video_options', true );
if ( $vp_meta != '' && $vp_meta['video_type'] == 'youtube_url' ) {
$youtube_url = 'http://www.youtube.com/watch?' . $vp_meta['youtube_url'];
$markup = $youtube_url . ' ' . $markup;
}
return $markup;
}
add_filter( 'video_thumbnail_markup', 'custom_vp_video_thumbnail_markup', 10, 2 );
Sorry, no dice.
I’m just going to have to do it manually.
Thank you for all of your help though.
I wish I could fix this, just hard without access. Once the site is somewhere online feel free to let me know!
I just purchase Videopress and I don’t understand how it works. Where to upload the video and make comments. Could someone explain.
I’m sorry but as you appear to be using a commercial theme, you need to seek support from the theme’s developer/vendor. We do not support commercial products here.