I would like to add a link via custom post type so that an image appears based on the page template, but I can’t seem to show the link in between the img src, here is my php code for this:
<?php
$logoImg = print(get_post_meta($post->ID, 'Page Logo', true));
if ( is_page_template('second_page.php')) {
echo '<div class="middle-strip">' . '$logoImg' . '</div>';
}else{
echo '';
}
?>
Single quotes will just print the string $logoImg , and not its value.
This code would work :