I looked everywhere trying to find some code that could show me how to display the post thumbnail if there is an image, but to display absolutely nothing if there isn't an image to display (most just either added an image or there was a broken image if there was nothing to display).
- <?php if (get_post_meta($post->ID, 'post-image', true) != "" ) : ?>
- <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="borderimg">
- <?php $thumbnail_image = get_post_meta($post->ID, 'post-image', true);?>
- <img src="<?php bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php echo $thumbnail_image; ?>&h=141&w=200&zc=1" alt="" />
- <?php endif; ?>
You need to login to post a comment.