Viewing 1 replies (of 1 total)
  • This is UNTESTED, but should be close:

    <?php
    $url1 = get_post_meta($post->ID,'thumbnail_ID_URL1',true);
    $url2 = get_post_meta($post->ID,'thumbnail_ID_URL2',true);
    if ($url1) {
       $src = "http://blah.com/$url1.jpg";
    } elseif ($url2) {
       $src = "http://meh.com/$url2.jpg";
    } else {
       $src = 'http://myurl.com/default.jpg';
    }
    ?>
    <img src="<?php echo $src; ?>" />
Viewing 1 replies (of 1 total)

The topic ‘Conditional statement using Custom Fields’ is closed to new replies.