Home › Forums › Back End › Display image as link if URL is added to custom field for CPT › Reply To: Display image as link if URL is added to custom field for CPT
October 2, 2013 at 11:53 pm
#151937
asiek
Participant
////////// S O L V E D \\\
All I had to do was remove the echo
from a couple lines and now the numbers are gone :)
My new code//
<?php
$overlays_dll = get_post_meta($post->ID, 'overlays_dll', true);
if ( $overlays_dll ) {
echo '<a href="';
echo $overlays_dll;
echo '">';
$overlays_image = get_post_meta($post->ID, 'overlays_image', true);
echo wp_get_attachment_image($overlays_image, 'full');
echo '</a>';
}
else {
$overlays_image = get_post_meta($post->ID, 'overlays_image', true);
echo wp_get_attachment_image($overlays_image, 'full');
}
?>