• I recently purchased the VideoPress theme from ThemeForest and I’m having some difficulty getting your plugin to work properly. I scoured the theme for a custom field name so I could properly link the video URL to Video Thumbnails but, in the end, I had to ask the developer of the theme. Here was his response:

    The theme uses a different metabox and is stored directly on the database rather than the native WP custom field.

    Anyway to pull data from the posts video you can use this.

    For Embed Code echo vp_metabox(‘video_options.embed_code’);

    For External URL and or Youtube URL echo vp_metabox(‘video_options.youtube_url’);

    For Uploaded Videos echo vp_metabox(‘video_options.video_upload’);

    Now that I know the variable that I need to echo in php, what would I modify, or safer yet in my fucntions.php, so that I can link the video URL to Video Thumbnails?

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

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

    (@sutherlandboswell)

    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.

    Thread Starter joejozwowski

    (@joejozwowski)

    I assume that I would throw the above code into my functions.php?

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Yep!

    Thread Starter joejozwowski

    (@joejozwowski)

    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.

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    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.

    Thread Starter joejozwowski

    (@joejozwowski)

    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.

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    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 );
    Thread Starter joejozwowski

    (@joejozwowski)

    Sorry, no dice.
    I’m just going to have to do it manually.
    Thank you for all of your help though.

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    I wish I could fix this, just hard without access. Once the site is somewhere online feel free to let me know!

    Alicx

    (@alicx)

    I just purchase Videopress and I don’t understand how it works. Where to upload the video and make comments. Could someone explain.

    esmi

    (@esmi)

    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.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Video Thumbnails in VideoPress Theme’ is closed to new replies.