I am attempting to have an image in a post show only if a meta value is present, and then resizing the visible and linked image via Timthumb. If I pull the code out of the if,else statement it works great. When its in the statement it just displays the Source URL of the image.
I am sure there is something simple that I am missing. I just need some help to move on after spending way too much time trying to figure this out.
<?php
if (the_field('main_post_image') == '') {
echo '';
} else { ?>
<a class="zoom" href="/images/img-resize/timthumb.php?src=<?php the_field('main_post_image'); ?>&w=1000">
<img src="/images/img-resize/timthumb.php?src=<?php the_field('main_post_image'); ?>&h=200&w=640" alt="" height="200" width="640" />
</a>
<?php }; ?>
I appreciate any help you guru's can provide me!