Use custom fields in Wordpress with posts
Posted in Wordpress <?php // if there are custom fields, echo them here in the looped content and build our related leftbox
if($img !== '') { ?>
<div class="entry_customFields">
<p>
<img src="<?php echo $img2; ?>"
class="<?php if($img_class !== '') { echo 'portfolio_img_thumb'; } else { echo ''; } ?>"
alt="<?php if($img_alt2 !== '') { echo $img_alt2; } else { echo ''; } ?>"
/>
</p>
</div>
<div class="entry_customFields">
<p>
<a href="<?php echo $img3; ?>" target="_blank"><img src="<?php echo $img3; ?>"
class="<?php if($img_class !== '') { echo 'portfolio_img_thumb'; } else { echo ''; } ?>"
alt="<?php if($img_alt3 !== '') { echo $img_alt3; } else { echo ''; } ?>"
/></a>
</p>
</div>
<?php } // end if statement
// if there's not a custom field
else { echo ''; } ?>



ShareThis