Oh man, yes, that’s it.
<?php if(get_field('profile_mail', $employee->ID)): ?>
<div class="profile__mail">
<a href="mailto:<?php echo get_field('profile_mail', $employee->ID); ?>" class="profile__link">
<?php echo get_field('profile_mail', $employee->ID); ?>
</a>
</div>
<?php endif; ?>
Thanks a lot.
The first code snippet is in single.php and indicates the employee that was entered in the post. The second code snippet displays in a separate page template only the selected employees, which are selected by post object.
If I omit the if(get_field) statement for profile_phone and profile_mail, it works because the entries are always given in each case. But I don’t understand why nothing is displayed if the if(get_field) statement exists.
This reply has been marked as private.
This reply has been marked as private.