Hi all this is wordpress php question I am trying to get thumbnail from custom field image. Please help me with the code thank you so much.
<?php
if (get_post_meta($post->ID, 'thumbnail', true)) {
echo "<img src='echo get_post_meta($post->ID, 'thumbnail', true)' width='100px' />";
}else{
echo "<img src='http://site.com/default.jpg' width='50px' />";
}
?>
Above code results default pic where custom field image is not added but is giving out img code shown below as output for custom filled image.
<img src='echo get_post_meta(86, ''thumbnail'', true)' width='100px' />