Show image with link only if field has value
gistfile1.php
<?php
$shop_url = get_custom_field( 'shop_url' );
if( ! empty( $shop_url ) ){
echo "<a href="" . esc_url( $shop_url ) . "" target="_blank"><img src="//domain.com/banners/gotoshop.jpg"></a>";
}
No comments yet.