How to hide image-url if no attachment?
Assuming you’re following this tutorial: http://wp.tutsplus.com/tutorials/automagic-post-thumbnails-image-management/ Replace the echo statement at the end of get_attachment_picture with a return, then change your image code. Here is your new image code: // get the URL of the image $src = get_attachment_picture(); // if the url is not empty, display the image if(!empty($src)){ ?> <img src=”https://wordpress.stackexchange.com/questions/48896/<?php echo $src; … Read more