I was able to figure this out myself. I am sharing here in case anyone else needs to know. I am using WP Types plugin to create custom post types and custom fields.
function my_wpc_disable_featured_image_link( $featured_image, $params ) {
if ( $params['params']['show_featured_image'] === 'true' ) {
$data_src = 'src="' . $params['image'] . '"';
$image_class = null;
$link = types_render_field("company-website", array("target"=>"_blank","output" => "raw"));
if ($params['params']['lazy_load'] === 'true') {
$data_src = 'data-src="' . $params['image'] . '" data-src-retina="' . $params['image']. '"';
$image_class = 'class="owl-lazy"';
}
$featured_image = '<div class="wp-posts-carousel-image">';
$featured_image.= '<a href="' . $link . '"><img alt="' . $params['post']->post_title . '" style="max-width:' . $params['params']['image_width'] . '%;max-height:' . $params['params']['image_height'] . '%" ' . $data_src . $image_class . '></a>';
$featured_image.= '</div>';
return $featured_image;
}
}
add_filter('wpc_item_featured_image', 'my_wpc_disable_featured_image_link', 1, 2);
Quick not – I used the disable link function that the plugin developer provided as an example on another support thread.
Sorry for the delay.
I’m glad that you found the solution, and thanks for sharing the code 🙂