Updated the answer to match my latest comment:
Changing <?php if (the_post_thumbnail()): ?>
to <?php if (has_post_thumbnail()): ?>
will probably solve things.
Also, some must have developer plugins when working with featured images:
Updated the answer to match my latest comment:
Changing <?php if (the_post_thumbnail()): ?>
to <?php if (has_post_thumbnail()): ?>
will probably solve things.
Also, some must have developer plugins when working with featured images: