Support » Plugins and Hacks » Custom fields – linked image

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)


    Forum Moderator


    You’re missing brackets for the if/elsif and foreach. Try:

    <?php $withdrawals=get_post_meta($post->ID,'withdrawals',false); ?>
    <?php foreach($withdrawals as $withdrawal) {
    if($withdrawal == 'http://127.0.0.1/mysite/wp-content/themes/TEST/images/takeback.png') { echo '<a href="http://www.mysite.net/url/here/"><img src="'.$withdrawal.'" /></a>' ;
    elseif($withdrawal=='') echo '<img src="'.$withdrawal.'" />&nbsp;';
    }?>

    esmi, thank you som much!!

    Damn… I got a parse error.. on the last line:

    elseif($withdrawal=='') echo '<img src="'.$withdrawal.'" />&nbsp;';

    Anyone ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom fields – linked image’ is closed to new replies.