Fix handling of empty locations array

This commit is contained in:
Markus Ankenbrand 2024-10-29 22:38:41 +01:00
parent f56520fbad
commit f8f75ae653

View file

@ -75,7 +75,7 @@
<?php endif; ?>
<?php $location = get_field( 'ort' ); ?>
<?php $locations = get_field( 'orte' ); ?>
<?php if ( $location && !$locations ) : ?>
<?php if ( $location && (!$locations || count($locations)==0) ) : ?>
<div class="post-meta">
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-single'></div>
<script type='text/javascript'>
@ -94,7 +94,7 @@
</script>
</div>
<?php endif; ?>
<?php if ( $locations ) : ?>
<?php if ( $locations && count($locations)>0 ) : ?>
<div class="post-meta">
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-multiple'></div>
<script type='text/javascript'>