Need a tripple variable to show Image
-
Hello together,
i hope to have here a easy to solve question… I get only a headache of it.
I have two plugin that are showing me preview pics on the main page, but both do it with a different custom field variable “preview” and “pl_preview_lt”.
I could figure out after long long discussions with my theme that i need this code to show one or the other one, depend on what is available:
<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"> <?php $thumb = wela_getcustomfield('preview',get_the_ID()); if(!empty($thumb)) { ?> <img src="<?php echo $thumb; ?>" alt="<?php the_title_attribute(); ?>" class="preview"/> <?php } else { ?> <?php } $thumb = wela_getcustomfield('pl_preview_lt',get_the_ID()); if(!empty($thumb)) { ?> <img src="<?php echo $thumb; ?>" alt="<?php the_title_attribute(); ?>" class="preview"/> <?php } ?> </a>Took me a while, but its running now.
BUT, if i have neither one of the custom fields, i need a replacement.. a simple Placeholder graphic.
That i can’t get right in any form and i have no idea how to get that, does someone could add just that line to the code? I still have no idea of PHP, but there must be an easy solution 🙁
Thanks in advance already
Sascha
The topic ‘Need a tripple variable to show Image’ is closed to new replies.