Show image custom field as thumbnail

With Content Views Pro, you can display WordPress featured image, or image inside post content as thumbnail of post easily without coding.
If you have an image custom field, and want to show that custom field as thumbnail, please add this code to file functions.php of your active theme:

// CVPro - Use custom field as thumbnail
add_filter( 'pt_cv_field_content_excerpt', 'cvp_theme_custom_field_as_thumbnail', 100, 3 );
function cvp_theme_custom_field_as_thumbnail( $args, $fargs, $post ) {	
	if ( empty( $fargs ) ) {
		$meta = get_post_meta( $post->ID );

		if ( !empty( $meta[ 'CUSTOM_FIELD_NAME' ][ 0 ] ) ) {
			$args = sprintf( '<img src="%s">', $meta[ 'CUSTOM_FIELD_NAME' ][ 0 ] );

	return $args;

Please replace CUSTOM_FIELD_NAME with name of your custom field.

Notice: If you created custom field with Toolset plugin, you may need to add prefix wpcf-. For example, you created a custom field post-image with Toolset plugin, then the value of CUSTOM_FIELD_NAME should be wpcf-post-image.

Best regards,