Hi there, I am scratching my head for ages trying to get this to work. I am adapting a script that simply outputs a floorplan image from a MySQL database. Only problem is that it outputs the <DIV> and all the title and formatting even if no image exists. I only want to output the <DIV> if an image exists. Thanks in advance for any help. Charlotte
<div id="property-contact">
<h2 id="h2-section" class="h2-section"><?php _e('Floor Plan',TS_DOMAIN) ?></h2>
<div class="box2 clearfix">
<?php $floor_plans_image_id =get_post_meta($post->ID, "_thumbnail_id", true);
$myrows = $wpdb->get_results( "SELECT guid FROM wp_posts WHERE ID=".$floor_plans_image_id );
?>
<a href="<?=$myrows[0]->guid?>" rel="prettyPhoto[gallery]"><img src="<?=$myrows[0]->guid?>" width="250px;"/></a>
</div><!-- end box3 -->
</div>