Fix conditions

This commit is contained in:
Markus Ankenbrand 2024-10-29 23:42:25 +01:00
parent c57cb3fec7
commit b2e18e40ac

View file

@ -76,13 +76,11 @@
<?php $location = get_field( 'ort' ); ?> <?php $location = get_field( 'ort' ); ?>
<?php $locations = get_field( 'orte' ); ?> <?php $locations = get_field( 'orte' ); ?>
<?php <?php
echo var_dump($location); if ( $location && (!$locations || count($locations)==0) || is_nan($locations[0]['lat']) ) {
echo "<br>";
echo var_dump($locations);
if ( $location && !$locations ){
$locations = [$location]; $locations = [$location];
} }
?> ?>
<?php $locations = get_field( 'orte' ); ?>
<?php if ( $locations && count($locations)>0 && !is_nan($locations[0]['lat'])) : ?> <?php if ( $locations && count($locations)>0 && !is_nan($locations[0]['lat'])) : ?>
<div class="post-meta"> <div class="post-meta">
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-multiple'></div> <div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-multiple'></div>