Home › Forums › Pro Support › Link image in custom filed to the post url › Reply To: Link image in custom filed to the post url
November 19, 2018 at 6:00 pm
#6479
Keymaster
Try this:
add_action( 'wpsp_before_title', 'tu_add_custom_meta' );
function tu_add_custom_meta() {
$image = get_post_meta( get_the_ID(), 'cami_thumb', true );
$permalink = get_permalink();
if ( isset( $image ) && '' !== $image ) {
echo '<div class="imagen-producto"><a href="' . $permalink . '"><img src="' . $image . '"></a></div>';
}
}