Custom fields – linked image
-
I want to display (several) images from a custom field. If one of these images are presented, it is supposed to be linked. But I only get parse errors when trying to link it.
Here is the code:<?php $withdrawals=get_post_meta($post->ID,"withdrawals",false); ?> <?php foreach($withdrawals as $withdrawal); if($withdrawal == 'https://127.0.0.1/mysite/wp-content/themes/TEST/images/takeback.png' { echo "<a href=\"https://www.mysite.net/url/here/"><img src="".$withdrawal."\" /></a>" ; } elseif($withdrawal=='' { echo "<img src=\"".$withdrawal."\" /> "; } ?>
PHP is hard for me..anyone out there with a bright eye and a brigt idea?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Custom fields – linked image’ is closed to new replies.